Git Commands

Setting up repositories

Task

Command

Clone a repository X to destination

git clone url destination

Add other addresses for related repositories

git remote add remotename url

View addresses of related repositories

git remote -v

What is upstream?

?

Task

Command

View branches

git branch

View tags

git tag

Switch branch/tag

git checkout branch_or_tag

View graphical tree

git log --oneline --abbrev-commit --all --graph --decorate

View file history

git log path/to/file

Authorship of file by line

git blame path/to/file

Committing

Task

Command

Stage work for commit

git add path/to/file

Stage work for commit piecemeal

git add -i

Commit work

git commit

GitCommands (last edited 2013-12-13 17:21:34 by 208)