89

使用 GitHub for Windows,您可以“发布”一个分支,然后将该分支“同步”到 GitHub。

在此处输入图像描述

同步基本上是一个git pullgit push?或者还有更多?如果我想从命令行执行与“同步”完全相同的步骤,我该怎么办?

(它不是开源的,或者我只是读过。)

4

4 回答 4

53

同步git pull --rebase,然后如果有本地更改,它会git push

从这里:http ://haacked.com/archive/2012/05/21/introducing-github-for-windows.aspx#87318

于 2012-12-21T01:14:20.873 回答
44

由于上面的答案是两年多以前的,因此对这个问题的更新答案是:由于rebase的一些错误,“同步”按钮git pull --rebase不再起作用。相反,根据此发行说明(请参阅 1.3.0 版),如果存在冲突,git pull它将执行合并。

上面的链接暂时不可用。这是新的发行说明

于 2014-11-29T10:23:13.580 回答
17

"Sync" would be any actions necessary to have your local branch match your remote branch. If your local branch had commits that your remote branch didn't, then "sync" would push your branch. If the remote branch was ahead of your local branch, then "sync" would pull first (specifically, git pull --rebase, as was explained by Phil Haack). "Sync" is just a shortcut to getting the local and remote to mirror each other.

From the GitHub site:

The sync button turns the complex workflow of pulling and pushing into a single operation. It notifies you when there are new changes to pull down and lets you quickly share local changes.

于 2012-08-24T07:05:21.110 回答
4

要添加到@ethanyang 的答案

根据gitconfig中配置的别名,

[alias]
...
sync = !git pull && git push
于 2015-10-12T19:24:35.473 回答