Android的Studio更新项目:合并衍合VS VS分公司默认 [英] Android Studio Update Project: Merge vs Rebase vs Branch Default

查看:2445
本文介绍了Android的Studio更新项目:合并衍合VS VS分公司默认的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

道歉,如果这似乎是多余的,因为我知道有关于合并VS再次基于问题相当数量,但似乎并没有被任何扔在分行默认为好。

Apologies if this seems redundant as I know there are fair amount of questions regarding Merge vs Rebase, but there doesn't seem to be any that throw in 'Branch Default' as well.

正在给,你必须多个人做某件事(即机器人工作室的Andr​​oid应用程序)同时的情况。什么是更新项目/拉,如果有人推到主分支的最佳选择,要在新的主拉,使得它不会覆盖你还在工作的工作,还没有提交并推送掌握? Android的工作室名单'合并'再次基于'和'分公司默认时,点击更新项目。从它听起来像,我愿意这样做再次基于'(其次是合并?),但我不能完全肯定。

You are given a case where you have multiple people working on something (i.e. an Android app in Android Studio) concurrently. What is the best option to update project/pull if someone pushes to the master branch and you want to pull in the new master such that it doesn't overwrite the work you are still working on and have yet to commit and push to master? Android Studio lists 'Merge' 'Rebase' and 'Branch Default' when clicking 'Update Project'. From what it sounds like, I would want to do 'Rebase' (followed by 'Merge'?), but I'm not entirely sure.

推荐答案

积攒

这里的关键是,你必须要保存提交的工作。在试图在合并任何东西,你应该藏匿的更改保存您提交的修改和清理你的工作目录。

The key here is that you have uncommitted work that you want to save. Before trying to merge anything in, you should stash your changes to save your uncommitted changes and clean your working directory.

运行 git的藏匿来藏匿更改。然后,您应该能够拉的变化没有任何问题。

Run git stash to stash your changes. You should then be able to pull the changes without any issues.

在您成功拉,你可以做一个 git的藏匿适用来重新申请,你就先于拉进行。修改

After you have successfully pulled, you can do a git stash apply to re-apply the changes you had made prior to the pull.

合并和重订基

积攒的更改只有当你只有未提交的变化。如果在某些时候你承诺,但并没有强迫你要么需要衍合或合并。

Stashing your changes only works if you only have uncommitted changes. If at some point you committed but didn't push you will need to either rebase or merge.

这个计算器帖子对分歧一些伟大的信息。

This StackOverflow post has some great information on the differences.

在一般情况下,合并是比较容易的,但一些人认为它污染的混帐历史合并提交。

In general, merging is easier, but some believe that it "pollutes" the git history with merge commits.

衍合需要额外的工作,但因为你没有一个合并提交这实际上将使合并无形。

Rebasing requires additional work, but since you don't have a merge commit it will essentially make the merge invisible.

此外,你的情况,你应该不需要合并或重订。简单地藏匿,拉,然后应用藏匿,它都应该是不错的。

Again, in your case you shouldn't need to merge or rebase. Simply stash, pull, then apply the stash and it should all be good.

这篇关于Android的Studio更新项目:合并衍合VS VS分公司默认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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