git tfs:如何在git中进行另一次checkin时检查git? [英] git tfs: How to rcheckin git commits when there is another checkin in tfs?

查看:888
本文介绍了git tfs:如何在git中进行另一次checkin时检查git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于没有访问我们的TFS的远程工作者,我们使用git tfs克隆了一个TFS仓库。当我们找回他的存储库时,我们看到他在一个新的功能分支上工作。



在试图检查他的更改之前,我们将其功能分支合并到主分支中。由于他没有任何东西来掌握,所以发生了一个快速前进,导致了一个单一的流git日志。
不幸的是,自从最初的克隆在TFS上发生了另一个(完全不相关的)签入。
当我们尝试rcheckin时,会收到以下错误消息:

pre $ 从TFS获取更改以最大程度减少迟到的可能性冲突...
错误:找到新的TFS变更集。
您可能能够解决此问题。
- 尝试将HEAD重新绑定到最新的TFS签入并重复rcheckin或者checkin s

I不明白如果我们需要所有的提交反映为TFS签入,那么建议的rebase会有什么帮助。



有没有办法让所有的git提交作为单独的TFS签名在这种情况下呢?

解决方案

@Cupcake的答案很好,但我想添加一些东西......



如果您想在此步骤中签入并解决您的合并冲突时比tfs工作流程更近,则可以使用:

  git tfs rcheckin --quick --autorebase 

这相当于:

  git tfs pull --rebase 
git tfs rcheckin

这不一定是更好的做法,因为通常在 pull --rebase (你的变化和来自tfs的变化是合并')和 rcheckin (您将更改推送到tfs),您至少应该构建您的解决方案并运行单元测试。



但是我意识到有时候这会更容易,我的团队(所有旧的tfs用户)只想这样做!



您还应该请注意,在 pull --rebase 步骤中,您的更改与您的团队进行了合并,因此合并是在文件级完成的,并且与tfs当您签入时,您必须解决冲突。



rcheckin --quick --autorebase ,如果有冲突,命令将退出。你将不得不解决它们并再次发出命令。

For a remote-worker without access to our TFS we cloned a TFS repository using git tfs. When we got back his repository we saw that he worked on a new feature branch.

Before trying to rcheckin his changes, we merged his feature branch into the master branch. Since he didn't commit anything to master, a fast forward took place, resulting in a single stream git log. Unfortunately, since the initial clone another (completely unrelated) checkin happened on TFS. When we try to rcheckin, we get the following error message:

Fetching changes from TFS to minimize possibility of late conflict...
error: New TFS changesets were found.
You may be able to resolve this problem.
- Try to rebase HEAD onto latest TFS checkin and repeat rcheckin or alternatively checkin s

I do not understand how the suggested rebase could help if we need all commits to reflect as checkins on TFS.

Is there any way to get all the git commits as individual TFS checkins in this situation?

解决方案

The answer of @Cupcake is good but I want to add some things...

If you want to be nearer than the tfs workflow when just checked in and solve your merge conflicts during this step, you could use:

git tfs rcheckin --quick --autorebase

which is equivalent to :

git tfs pull --rebase
git tfs rcheckin

It's not necessarily the better thing to do because, normally between the pull --rebase (where your changes and the one coming from tfs are 'merged') and the rcheckin (where you push your changes to tfs), you should at least build your solution and also run your unit tests.

But I recognized that sometimes it's a lot easier and my team (all old tfs users) only want to do that!

You should also be aware that's during the pull --rebase step that your changes are 'merged' with the ones of your team so that's where merged are done at the file level and like with tfs when you checked in, you will have to solve conflicts.

In the case of the rcheckin --quick --autorebase, if there is conflicts, the command will exit. You will have to solve them and lauch the command again.

这篇关于git tfs:如何在git中进行另一次checkin时检查git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆