-
-
Save blokhin/26c6db1ccad2231e05befe99425a0470 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# common GIT tips | |
git show HEAD~0:index.html | |
git log --graph --oneline --date-order --decorate --color --all | |
git diff --name-status master..somebranch | |
git diff somebranch master -- myfile | |
git commit --amend -m "New commit message" | |
git archive --format zip --output /full/path/to/zipfile.zip master | |
git archive --format tar --output ~/.tar master | |
git remote set-url origin git://new.url.here | |
git shortlog -s -n | |
git checkout otherbranch myfile.txt | |
git ls-tree -r master --name-only | |
# NB non empty repo init | |
git init | |
git remote add origin PATH/TO/REPO | |
git fetch | |
git checkout -t origin/master | |
# Pull request from fork to upstream | |
git remote add upstream https://github.com/whatever/whatever.git | |
git fetch upstream | |
# SUBMODULES | |
git add .gitmodules | |
git submodule add https://github.com/mpds-io/mpds-ml-labs.git gen/ml | |
git submodule update --remote gen/ml | |
git submodule foreach --recursive 'git pull origin gh-pages' | |
git submodule update --init --recursive | |
# offline usage | |
git bundle create repo.bundle --all | |
# squash commits | |
git rebase -i --root master | |
git rebase -i HEAD~X |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment