git clone <somerepo> .
git branch -a // View all branches
git checkout -b <branch_name> origin/<branch_name>
git branch -a // View all branches
git checkout -b <branch_name> origin/<branch_name>
git diff <source_branch> <target_branch> - changes between 2 branches
git diff HEAD - changes with latest commit
git diff --staged - diff with staged files
git reset <file> - unstage <file>
git branch <branch_name> - creates branch <branch_name>
git checkout <branch_name> - switch branch to <branch_name>
git branch -d <branch_name> - delete <branch_name> branch
git checkout <branch_name> - now we'r in the <branch name>
git merge <other_branch_name> - merge <other_branch_name> changes into <branch_name>
git pullCreating tag:
git tag 1.0.0 b01a419cffThe b01a419cff is a commit id.
git fetch origin
git --hard origin/master
git add --all2. Changes in Index (staged)
git commit -m "Adding all files"3. Changes in HEAD (commited, but still not in remote repo)
git push origin <branch_name> (git push origin master)4. Now changes pushed to remote repository (master or other branch)
gitk