How to create a new local branch?
git checkout -b <branch>
How to push a new local branch to remote?git push origin <branch>
How to push a new local branch to remote and track it?git push -u origin <branch>
How to remove remote?git remote remove origin
git remote rm origin
How to add a remote?
git add origin <url to remote>
How to remove remote and add a new one?git remote set-url origin git://new.url.here
How to see diff on uncommitted files with their previous version?
git diff <file name>
How to see git diff on a added file with its previous version?
git diff --cached <file name>
How to see diff on a committed file with its previous version?
git diff HEAD^ <file name>
How to add a tag on a branch?
git tag <tag name>
How to delete a tag?
git tag -d <tag_name>
How to list all tags?
git tag
How to push tag to remote?
git push --tags
How to see commit history?
git log
How to see commit history with files committed?
git log --stat
How to check out a perticular commit from commit log?
git checkout <commit id>
This is all for the moment will add more as and when I come across :)
No comments:
Post a Comment