-
Notifications
You must be signed in to change notification settings - Fork 4
Git random notes
Jinlian(Sunny) Wang edited this page Oct 30, 2015
·
13 revisions
- Use
git tag -d [tagname]to delete a tag and then usegit push --tagsto push it. - 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.
- Use 'git reset --hard' to clean up the working copy.
- Use 'git reset HEAD~n' to revert the recent commits but keep them in the working copy.
- Use git as a web server
http://htmlpreview.github.io/?https://github.com/JinlianWang/RandomNotes/blob/gh-pages/index.html - Note: Asked to give a presentation over Git. The slides can be found Here.
- git log --author="[pattern]" to list all commit by one person.
-
git log --oneline --graph --color --all --decorateto view git log visually - Find out all the gits from an author:
git log --author="[author name or part of it]" - 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