Add remote RemoteName from specific URL (SSH)
git remote add RemoteName [email protected] :repository.git
Get informations about the remote
git remote show origin
git push origin :BranchName
Sync a repository from another one
git remote add original_project git://github.com/repo/project.git
git fetch original_project
git checkout master
git merge original_project/master
git branch -u origin/branchName branchName
git branch --set-upstream-to=origin/branchName branchName
git branch --set-upstream branchName origin/branchName
git checkout -b banchName origin/banchName
Update remote branch list
git remote prune origin
Update remote branch list in Dry-run mode
git remote prune -n origin
Merge BranchA into BranchB
git checkout BranchB
git merge BranchA
Rename local branchA to branchB
git branch -m branchA branchB
Rename remote (origin) branchA to branchB
git push origin branchA:branchB
git branch -D BranchName
git push origin :BranchName
git tag
git tag -a TAG_NAME SHA1_COMMIT
git-ls-remote --tags
List local tags with short description
git tag -n
git tag OLD_TAG_NAME NEW_TAG_NAME
git tag - d TAG_NAME
git push origin --tags
git pull origin --tags
Differences between 2 branches - detailed
git diff master..develop > diffs.log
Differences between 2 branches - summary
git diff --name-status master..develop > diffs-summary.log
Differences between 2 files
git diff master:file.php develop:file.php
git log
git log --graph --oneline --all
View history for a specific file
git log --follow -p file
View commit count per contributors
git shortlog -sne
This can save my life ! Ty