Andy Wenk - 17.11.2009
This is the second part of some notes to myself concerning git. Let's first have a look to some basic commands
actualize the repo $ git pull
show the status of the repo $ git status
add the changes to the repo $ git commit changed-files
see the changes $ git log changed-file
move all changes made in a branch to master $ git checkout master $ git merge changed-file-from-my-branch
Changes made to files sometimes have to be reverted.
revert the changes made to the repo using the commit id $ git revert 3c15fa6687dbecad7bced5c3d0f4130894bc17e4
revert (after commit) alternatively to HEAD $ git revert HEAD
revert all changes bevor a commit $ git reset --hard HEAD
revert only changes made to a specific file (first overwrite the changed file with the one in the remote repo and then move it to HEAD) $ git checkout -- changed-file $ git checkout HEAD changed-file
Now some commands related to bramnches
create a branch $ git branch postgresql-aw
see all branches $ git branch -a
delete a branch $ git branch -d postgresql-aw
create a branch and get all updates from master $ git branch --track postgresql-aw
change to the branch $ git checkout postgresql-aw
$ git format-patch origin/master
With these commands, it should be easy to start with git.