forked from dcxy/learngit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzhaotliang.txt
71 lines (52 loc) · 1.39 KB
/
zhaotliang.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
63
64
65
66
67
68
69
70
71
Git
By ZTL
---1---
git config --global user.name "zhaotongliang"
git config --glabal user.email "294064077@qq.com"
git ini
git add ***
git commit -m "***"
git status
git diff
git reset --hard commit-id
git reset --hard HEAD^ -------HEAD^^^ is OK
git log
git reflog
git checkout -- *** -------丢弃工作区
git reset HEAD *** -------从暂存区放回工作区
git rm ***
---2---
git remote add origin git@server:path
git push -u origin master
git push origin master
git clone git@server:path -------默认名字是origin,默认指抓取master分支
---3---
git branch
git checkout -b ***
git merge ***
git branch -d ***
git log --graph --pretty=oneline --abbrev-commit
git merge --no-ff -m "***" *** -------如果不noff,只要可能是fast foward就会是
git stash
git stash pop
git stash apply stash@{}
git stash list
dit stash drop stash@{}
git branch -D ***
---4---
git remote
git remote -v
git push origin *** -------***指分支名
git checkout -b *** origin/*** -------Clone后本地建立对应的分支
git pull
git branch --set-upstream *** origin/*** --------若git pull不成功,需要先关联本地和远程分支
---5---
git tag ***
git tag *** commit-id
git show ***
git tag -a *** -m "***" commmit-id
git tag -d ***
git push origin ***
git push origin --tags
git push origin:refs/tags/***
---6---