forked from dcxy/learngit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.xlshlr_git command.txt
62 lines (49 loc) · 1.41 KB
/
.xlshlr_git command.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
$ git config --global user.name "xlshlr"
$ git config --global user.email "[email protected]"
$ git init
$ git add readme.txt
$ git add file2.txt file3.txt
$ git commit -m "wrote a readme file"
$ git status
$ git diff readme.txt
$ git log --pretty=oneline
$ git reset --hard HEAD^
$ git reset --hard 3628164
$ git reflog
$ git diff HEAD -- readme.txt
$ git checkout -- readme.txt
$ git rm test.txt
$ git remote add origin https://github.com/xlshlr/firstblood.git
$ git push -u origin master
$ git checkout -b dev
$ git branch dev
$ git checkout dev
$ git checkout master
$ git merge dev
$ git branch -d dev
$ git branch -D feature-vulcan
git log --graph
$ git merge --no-ff -m "merge with no-ff" dev
$ git log --graph --pretty=oneline --abbrev-commit
$ git stash
$ git stash list
git stash apply
git stash drop
$ git stash pop
$ git stash apply stash@{0}
$ git push origin dev:dev // 提交本地dev分支作为远程的dev分支
$ git push origin :dev // 刚提交到远程的dev将被删除,但是本地还会保存的,不用担心
$ git push origin dev
$ git remote
$ git branch --set-upstream dev origin/dev
$ git tag v1.0
$ git tag
$ git tag v0.9 6224937
$ git show v0.9
$ git tag -a v0.1 -m "version 0.1 released" 3628164
$ git tag -s v0.2 -m "signed version 0.2 released" fec145a
$ git push origin v1.0
$ git push origin --tags
$ git tag -d v0.9
$ git push origin :refs/tags/v0.9
git push -u origin master