Skip to content
Jinlian(Sunny) Wang edited this page Oct 30, 2015 · 13 revisions
  1. Use git tag -d [tagname] to delete a tag and then use git push --tags to push it.
  2. FileMerge is the diff tool coming with Mac OX by default but it is not working great at times. You can use the DiffMerge which is better, and here tells how to install it on mac. After the installation is done, go to SourceTree/Preferences/Diff section, and pick DiffMerge as the visual diff and merge tool. You are good to go.
  3. Use 'git reset --hard' to clean up the working copy.
  4. Use 'git reset HEAD~n' to revert the recent commits but keep them in the working copy.
  5. Use git as a web server http://htmlpreview.github.io/?https://github.com/JinlianWang/RandomNotes/blob/gh-pages/index.html
  6. Note: Asked to give a presentation over Git. The slides can be found Here.
  7. git log --author="[pattern]" to list all commit by one person.
  8. git log --oneline --graph --color --all --decorate to view git log visually
  9. Find out all the gits from an author: git log --author="[author name or part of it]"
  10. It is not easy to update submodules in git. The following command may be helpful:
git submodule deinit -f [submodule name]
git rm [submodule name]
git rm --cached [submodule name]
cd .git/modules/
rm -rf [submodule name]
git submodule add '[submodule url]' [submodule name]
git submodule update --init
git submodule status

Clone this wiki locally