1 | 工作区-》暂存区-》本地库-》远程库(类似于:车间流水线-》运输车-》分部仓库-》总部仓库) |
2 | git config --global user.name "Your Name" |
3 | git config --global user.email "email@example.com" |
4 | git config --global color.ui true |
5 | git init |
6 | git add readme.txt |
7 | git commit -m "wrote a readme file" |
8 | git status |
9 | git diff readme.txt |
10 | git log --graph --pretty=oneline --abbrev-commit |
11 | git reflog |
12 | git reset --hard HEAD^ |
13 | git reset --hard 1094a |
14 | git reset HEAD readme.txt |
15 | git checkout -- readme.txt |
16 | ssh-keygen -t rsa -C "dalivk@163.com" |
17 | git remote -v |
18 | git remote add origin git@github.com:dalivk/learngit.git |
19 | git push -u origin master |
20 | git clone git@github.com:dalivk/gitskills.git |
21 | git checkout -b dev |
22 | git checkout -b dev origin/dev |
23 | git branch |
24 | git branch -r |
25 | git branch -d dev |
26 | git merge dev |
27 | git merge --no-ff -m "merge with no-ff" dev |
28 | git checkout -b dev |
29 | git branch --set-upstream-to <branch-name> origin/<branch-name> |
30 | git stash |
31 | git stash list |
32 | git stash pop |
33 | git cherry-pick 4c805e2 |
34 | git rebase |
35 | git tag -a v0.1 -m "version 0.1 released" 1094adb |
36 | git show v0.1 |
37 | git push origin v0.1 |
38 | git tag -d v0.1 && git push origin :refs/tags/v0.1 |
39 | git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
40 | source tree图形化git工具 |
41 | git cheat sheet https://gitee.com/liaoxuefeng/learn-java/raw/master/teach/git-cheatsheet.pdf |
42 | git rm -r --cached target/ |