X Tutup
Skip to content

Commit 952c5e2

Browse files
committed
update post
1 parent 89fb612 commit 952c5e2

File tree

1 file changed

+28
-26
lines changed

1 file changed

+28
-26
lines changed

_posts/2017-02-15-Git指令整理.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,34 @@ tags:
7777
# 重做上一次commit,并包括指定文件的新变化
7878
$ git commit --amend [file1] [file2] ...
7979

80+
#### 远程同步
81+
82+
# 下载远程仓库的所有变动
83+
$ git fetch [remote]
84+
85+
# 显示所有远程仓库
86+
$ git remote -v
87+
88+
# 显示某个远程仓库的信息
89+
$ git remote show [remote]
90+
91+
# 增加一个新的远程仓库,并命名
92+
$ git remote add [shortname] [url]
93+
94+
# 取回远程仓库的变化,并与本地分支合并
95+
$ git pull [remote] [branch]
96+
97+
# 上传本地指定分支到远程仓库
98+
$ git push [remote] [branch]
99+
100+
# 强行推送当前分支到远程仓库,即使有冲突
101+
$ git push [remote] --force
102+
103+
# 推送所有分支到远程仓库
104+
$ git push [remote] --all
105+
106+
107+
80108
#### 分支
81109

82110
# 列出所有本地分支
@@ -211,32 +239,6 @@ tags:
211239
# 显示当前分支的最近几次提交
212240
$ git reflog
213241

214-
#### 远程同步
215-
216-
# 下载远程仓库的所有变动
217-
$ git fetch [remote]
218-
219-
# 显示所有远程仓库
220-
$ git remote -v
221-
222-
# 显示某个远程仓库的信息
223-
$ git remote show [remote]
224-
225-
# 增加一个新的远程仓库,并命名
226-
$ git remote add [shortname] [url]
227-
228-
# 取回远程仓库的变化,并与本地分支合并
229-
$ git pull [remote] [branch]
230-
231-
# 上传本地指定分支到远程仓库
232-
$ git push [remote] [branch]
233-
234-
# 强行推送当前分支到远程仓库,即使有冲突
235-
$ git push [remote] --force
236-
237-
# 推送所有分支到远程仓库
238-
$ git push [remote] --all
239-
240242
#### 撤销
241243

242244
# 恢复暂存区的指定文件到工作区

0 commit comments

Comments
 (0)
X Tutup