Simple cheat sheet used to remember a few useful git commands
1. git fetch origin
2. git merge origin/BRANCH_TO_BE_MERGED (git diff BRANCH origin/BRANCH to see changes)
3. git checkout -b BRANCHNAME
4. git add
5. git commit -m "MESSAGE"
6. git push -u origin BRANCHNAME
7. (Web) create PR if applicable
8. git rebase -p origin/BASEBRANCH
9. git push -f
(web)
10. (Web) Merge PR -> Delete branch
11. git checkout develop
12. git fetch origin
13. git merge origin/develop
(command line)
10. git checkout develop
11. git merge --no-ff BRANCHNAME
12. Resolve conflits if any with 'subl filepath' (or any other editor) then git add . and git commit
13. git push origin develop
14. git branch -d BRANCHNAME
15. (web) delete branch
16. git tag TAGNAME
17. git push --tags
1. git stash save STASHNAME
2. git stash list
3. git stash apply stash@{POS}
4. git stash drop stash@{POS}
3. git stash pop
1. git reset COMMITHASH
2. git push -f
1. git tag -d TAGNAME (local)
2. git push --delete origin TAGNAME (remote)
1. git log --all --grep='TERM'
1. git log -p --all -S 'CODE_SNIP' --until=YYYY.MM.DD
1. git effort --above COMMITCOUNT -- --after="one month ago"
1. git log -p --all --follow PATH (source/build.gradle for android)
1. git remote prune origin
git applying gitignore for repository existing files (http://stackoverflow.com/a/7532131)
1. git ls-files -ci --exclude-standard
2. git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached
3. apply-gitignore = !git ls-files -ci --exclude-standard -z | xargs -0r git rm --cached