git log -p <filename>
git show --ignore-space-change <commit>
git diff --ignore-space-change <commit1> <commit2>
git rebase -i HEAD~4
See here for more details.
WARNING: Only do this if you haven't pushed those commits to someone else. Otherwise, inconsistent repos will be created and you won't be able to merge them anymore.
# Use git tag -l to see tags
# Use git tag -d <tagname> to delete a tag
git tag <tagname>
git push origin <tagname>
By commit hash: git show <COMMIT-HASH>
The i
-th to last commit: git show HEAD~i
git show <hash1> <hash2>
git show HEAD~i HEAD~j
git show HEAD~i HEAD
git submodule add --name 6.857-spring-2105 git@github.com:alinush/6.857-lecture-notes.git 6.857-spring-2015
One simple command:
git submodule foreach git pull origin master
More complicated (source here):
# get the submodule initially
git submodule add ssh://bla submodule_dir
git submodule init
# time passes, submodule upstream is updated
# and you now want to update
# change to the submodule directory
cd submodule_dir
# checkout desired branch
git checkout master
# update
git pull
# get back to your project root
cd ..
# now the submodules are in the state you want, so
git commit -am "Pulled down update to submodule_dir"
From SO post
mv a/submodule a/submodule_tmp
git submodule deinit -f -- a/submodule
rm -rf .git/modules/a/submodule
git rm -f a/submodule
# Note: a/submodule (no trailing slash)