InterviewSolution
| 1. |
How do you manage set of tracked/remote repositories? |
|
Answer» We ADD a remote repository(origin) USING command 'GIT remote add origin git@github.com:User/UserRepo.git' (you can change it later using command 'git remote set-url origin git@github.com:User/UserRepo.git'). 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. |
|