English 中文(简体)
吉唐:用当地档案存放偏远档案吗?
原标题:Git: Merge remote files with local files?
  • 时间:2012-01-12 16:51:30
  •  标签:
  • git

我是吉特人,并试图表明这一点。

我把一个遥远的存放处,比如说,我的当地机器有sh。 经过克隆,我编辑了一些文件,在此期间,偏远存放处也发生了变化。

我怎么能够更新我的当地存放处,同时保持两套变化?

最佳回答

公正承诺改变贵国的地方存放处

git commit

指挥。 Now you never lose your changes! Then pull new changes from remote repository using

git pull

指挥。 这一指挥系统带来了新的变化,与你的变化相融合。 通常没有冲突。 在这种情况下,你可以自由把你的变化推向遥远的存放处。 否则,你需要解决所有冲突,用解决冲突的方式来标示冲突。

git add

command (just use hints from git status output) and commit this merge using

git commit

指挥。

问题回答

“吉特拉”将把遥远的改动合并到你的当地文本中。 如果你想独立地维持你们的变革,你就可以在你拉开之前把变化转移到一个新的分支。 因此,如果你尚未作出改变,你可以这样做:

> git stash #stash the changes
> git branch dev_branch #create a new branch
> git checkout dev_branch #move to the new branch
> git stash apply #paste the changes into the new branch
> git checkout master #switch back to the master branch
> git pull #update the master branch

归根结底,你们的一部法典含有你们的改动(dev_branch)和一部与远距法相匹配的改动。 你们现在可以与遥远的法典无关。 (如果你知道你的话;请你发现,这是一种更加“干"”的工作方式——在你的主子里工作,并且“干 pull”在远距离变化中合并,是另一种“颠覆”的工作方式。)

you can use command git pull and this flag merge conflicts if any. If there are conflicts, resolve it and should do git commit





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签