We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f087736 commit 62ca828Copy full SHA for 62ca828
git.md
@@ -43,8 +43,40 @@ git branch -m new-branch
43
git pull
44
45
# 拉取远程仓库代码到本地其它分支
46
-git pull <remote-branch>:<local-branch>
+git pull origin <remote-branch>:<local-branch>
47
48
-#
+# 拉取远程分支代码到本地当前分支
49
+git pull origin <remote-branch>
50
```
51
52
+#### 提交相关
53
+
54
+```bash
55
+# 添加变更代码到暂存区(文件已被追踪)
56
+git add -u
57
58
+# 添加所有变更到暂存区
59
+git add .
60
61
+# 提交代码到本地仓库
62
+git commit -m 'xxxx'
63
+```
64
65
+#### 撤回相关
66
67
68
+# 放弃本地的一些变更
69
+git checkout <file-name>
70
71
+# 放弃本地所有变更
72
+git checkout .
73
74
+# 如果已经commit了且代码还在本地仓库,想撤回commit提交,且代码还想保留
75
+git reset
76
77
+# 代码回退到某一版本且这个版本之前的代码还想保留
78
+git reset <commit-hash>
79
80
+# 代码回退到某一版本且以前的代码都不要了
81
+git reset --hard <commit-hash>
82
0 commit comments