Book-Git从入门到精通

发布时间 2023-05-23 22:18:10作者: Theseus‘Ship

Book-Git从入门到精通

git add .
git add --all

git log --oneline --graph

git rm xxxx --cached

git commit --amend -m "xxxx" 修改最后一次commit信息
git rebase
git reset

git clean -fX 清除忽略的文件
git blame xxx
git blame -L 5,10 XXX 指定5~10行

git reflog 默认保留30天 查找分支的SHA-1
分支只是一个指向某个Commit的指向标

非文本文件冲突
git checkout --ours xxxx
git checkout --theirs xxxx

HEAD 缩写 @
ORIG_HEAD

手中任务做一半,临时切换别的任务
1.
git add --all
git commit -m "not finished yet."
git reset HEAD^

git stash
git stash list
git stash pop stash@{2}
git stash drop stash@{0}
git stash apply stash@{0}
pop --- apply+drop

filter-branch /ref/origina/refs/heads/master

cherry-pick

git branch --remote / -r 显示远端分支
git remote -v

git pus origin :cat 删除远端分支,推送空的内容更新在线cat分支内容,变相删除该分支。

git format-patch
git am xxx