Monday, March 11, 2013

A quick Git tutorial part 3

Link to a well explained git tutorial
gitref.org

git remote
If you clone a project from another machine, Git automatically sets the remote machine as the origin of the project. So when you want to update with the latest updates of the project you simply do:
git pull

With 'git remote' you can list your remote aliases, so this also means you can add remote machines that has the same git repo:
git remote add alias url
 
This way you can push new changes to a specific machine by giving the remote alias argument, for example:
git push yozef

Of course, you can also remove the alias:
git remote rm yozef

To show the remote list with extra information:
git remote -v

You can change url of an existing alias:
git remote set-url origin git://some.remote.machine/repo.git

To remove untracked files and folders after hard reset:
git clean -f -d

No comments:

Post a Comment

NSNotification example