[英]How do I synchronize master and origin/master using egit in eclipse?
I created a local git repository, and I push changes from it to a gitosis remote that I created with 我创建了一个本地git存储库,并将其中的更改推送到我创建的gitosis远程
git init my_git
git remote add origin git@server:my_git
... various adds and commits
git push origin master:refs/heads/master
Now, I edit and commit changes locally in eclipse, and when I commit, I see (using qgit) that it moves my master
branch to that version. 现在,我在eclipse中本地编辑和提交更改,当我提交时,我看到(使用qgit)它将我的
master
分支移动到该版本。
However, it also shows me that origin/master
is at the previous version. 但是,它还向我显示
origin/master
是以前的版本。
git status
on command line shows me everything is up to date: 命令行上的
git status
显示一切都是最新的:
$ git status
# On branch master
nothing to commit (working directory clean)
I can see the differences in versions with 我可以看到版本的差异
git diff origin/master
If i do git push
on my command line, then qgit shows me the origin/master
branch is now at same place as my master
. 如果我在我的命令行上执行
git push
,那么qgit会告诉我origin/master
分支现在和我的master
。
I can't work out how to configure the "remote / push" or "remote / configure push to upstream" dialog in eclipse to do the same thing as a command line git push
to move the origin/master
to the same level as the master
. 我无法弄清楚如何在eclipse中配置“远程/推送”或“远程/配置推送到上游”对话框,以执行与命令行
git push
,将origin/master
移动到与master
。
I always have to do the command line push to make the origin/master
come up to the same place as master
. 我总是要做命令行推送,使
origin/master
到达与master
相同的地方。
Q1. Q1。 Can anyone tell me how to do this in eclipse?
任何人都可以告诉我如何在日食中做到这一点?
Q2. Q2。 What is the command line version of
git push
doing that the eclipse version doesn't do? 什么是
git push
的命令行版本,eclipse版本没有这样做?
Q3. Q3。 Are my assumptions that
master
is my local HEAD pointer and origin/master
is the remote server's view of the current HEAD correct? 我的假设是
master
是我的本地HEAD指针而origin/master
是远程服务器对当前HEAD的正确视图吗?
Going by the relevant part of egit's documentation you can either: 按照egit文档的相关部分,您可以:
master
under both "Source ref" and "Destination ref" to only push your master
branch master
,只推送你的master
分支 The remote-tracking branch origin/master
is usually updated by git fetch
(which is part of what git pull
does), but with command line git, the remote-tracking branch is also updated on a successful push to the branch in the remote repository that's being tracked. 远程跟踪分支
origin/master
通常由git fetch
更新(这是git pull
所做的一部分),但是使用命令行git,远程跟踪分支也会在成功推送到远程存储库中的分支时更新正在跟踪。 It's possible that Egit, being based one of the pure Java implementations of git, JGit , rather than the command-line tools, doesn't update origin/master
on a successful push in the same way. Egit可能是基于git的纯Java实现之一, JGit而不是命令行工具,它不会以相同的方式在成功推送时更新
origin/master
。 If that's the case, you can just do a fetch to update origin/master
. 如果是这种情况,您只需执行提取即可更新
origin/master
。
Update : It seems that this is a known bug in EGit (not the underlying JGit) - the bug report is here: 更新 :似乎这是EGit中的一个已知错误(不是底层的JGit) - 错误报告在这里:
对此进行了更新,我使用的是eclipse Helios,并且已经使用最新版本的egit升级到Indigo,并且修复似乎是活动的,因为我不再需要在推动后拉动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.