computer:program:git
這是本文件的舊版!
Git
Branch
git branch --sort=committerdate
ASC
git branch --sort=-committerdate
DESC
Rebase
Hooks
git config --global core.hooksPath ~/.git/hooks
pre-commit
Worktree
Tip
Log
Reset
git reset origin/master --hard
Rebase
git rebase -s recursive -X <ours/theirs> master
git rebase --onto newbase upstream branch
Stash
- Show diff in git stash
git stash show -u
Branch
- Quick Switch Between Git Branches
git checkout -
git merge branch --no-commit --no-ff
Filter Branch
-
git filter-branch --index-filter "git rm -r -f --cached --ignore-unmatch TARGET" --prune-empty HEAD
也可加上 -q 抑制輸出,-f 強制把暫存區的備份清掉
Patch
git format-patch --no-prefix HEAD^
Diff
Blame
Subtree
git subtree push --prefix dist origin gh-pages
Ignore
git config --global core.excludesfile ~/.gitignore echo .DS_Store >> ~/.gitignore
Alias
Command
git checkout -- .
git rm --cached
git reflog
git shortlog
git fsck --no-reflogs
git commit --amend –C HEAD
git ls-files -o --directory --exclude-standard
git config --global user.name "Firstname Lastname" git config --global user.email "your_email@youremail.com"
git config --global color.diff auto git config --global color.status auto git config --global color.branch auto git config --global color.log auto
git config --global color.ui true
git config --global core.editor "vim"
git config --global alias.timeline "log --oneline --graph --decorate" git timeline
資源
Github
Pull Request
Tool
Service
Client
書籍
教學
工具
Hosting
rubygem
npm
grunt
介面
TUI
GUI
computer/program/git.1629134076.txt.gz · 上一次變更: 2021/08/16 17:14 由 wm
