Search This Blog

Tuesday, October 15, 2013

Git - tips for console users

Get the tree-like view of commits in terminal

git log --graph --oneline --all

Get current branch name

git branch

Pull and rebase local changes

git pull --rebase



Revert all local changes in a GIT managed project

git reset --hard HEAD

or

git checkout .
git reset
git revert ...

and

git clean -df & git checkout -- .
(and press enter)



Check whether there are any uncommited branches

git log --branches --not --remotes

Extract three topmost commits from the current branch 

git format-patch -3


Check if there are any conflicts before applying the patch

git apply --check patch_name.patch

Apply a patch file to the local work-space

git apply patch_name.patch




No comments:

Post a Comment

If you like this post, please leave a comment :)