We add a remote repository(origin) using command 'git remote add origin [email protected]
:User/UserRepo.git' (you can change it later using command 'git remote set-url origin [email protected]
We can list the remote repositories using 'git remote -v' command and this will display the name and the url of the remote repositories.
We push our changes up to our remote repository using command 'git push -u origin master'; here -u is upstream(use -u only for first push command just once), origin is remote name and master is the branch's name.
Then we'll do a pull from remote repository to our local git repository using 'git pull' or 'git pull <remote-name> <branch-name>' command to receive all your remote changes (commits) from the remote repository.