git-merge

Can git figure out that the branch to be merged has obsolete changes?

别说谁变了你拦得住时间么 提交于 2019-12-08 01:39:26
问题 I am new in git and I am find it hard to wrap my head around the fact that everything is around snapshots/commits and not individual files. So assume that I have a tree in my repository as follows. C4 (HEAD,Master,Origin/Master) * C3 * C2 * C1 Now I branch out from here: B1 (HEAD, testBranch) * C4 (HEAD,Master,Origin/Master) * C3 * C2 * C1 In my testBranch I only modify 2 files of the whole repository. Just 2. The development in master in the remote repository continues so eventually we have

bitbucket unable to merge, this field is required

早过忘川 提交于 2019-12-08 01:39:15
问题 I'm an ordinary bitbucket user who plays with git push git pull and git merge commands and never come across this weird situation. Now I'm trying to merge my feature branch into my master branch and getting this error: 回答1: From bitbucket site follow these steps: Go to Compare Select Destination and Source branches Select Compare button Select Merge button on top right corner 回答2: This error was a result of a bug that has now been fixed. 来源: https://stackoverflow.com/questions/42533093

Git bi-directional merging

纵饮孤独 提交于 2019-12-07 19:29:47
问题 I'm wanting to know the best approach for dealing with this git scenario: Git repo a: CoreProduct Git repo b: SpecificCustomerProduct which was forked from a Up until now, we have been making different changes to both a and b, and only merging a down to b. All good so far - the specific product is gaining features from our CorePoduct Now, we have ended up with some commits in b, that we would like to get back up into a (and there is new stuff in a that also needs to come down to b as usual)

Can I merge only non-conflicting changes in Git?

自作多情 提交于 2019-12-07 17:35:44
问题 How can I simply (e.g. in one command?) merge in Git, keeping the state of conflicting files as in the current branch and without specifying each file individually as in theirs/ours options? git checkout master git merge stable --some-option-to-keep-files-? 回答1: The merge strategy has an "ours" option which is what you want git merge -s recursive -X ours remote/branch As the manpage stresses out, this is NOT git merge -s ours. 来源: https://stackoverflow.com/questions/12572530/can-i-merge-only

Merging two branches and Git history

感情迁移 提交于 2019-12-07 15:29:12
问题 Please can somebody inform me what Git does in terms of history when merging two branches. If I have two branches which are both actively being developed on and both contain commits, which is similar to the following timeline: Branch #1: ----(branch)----C1----------C2-------(merge)------C5 \ / \ / \ / Branch #2: -----------C3----------C4 How does the history for Branch 1 look at C5 (commit #5) once both branches have been merged? I am under the impression Git will merge all history to give me

Merge 2 Different git Repos

北城余情 提交于 2019-12-07 15:13:18
问题 I have two different local git repos. Each is hosted on github as (separate) private repos, with its own set of collaborators / developers. I am the owner of those two github repos. # Repo A, which is in ~/projects/repo-a # Repo B, which is in ~/projects/repo-b I have two questions: * How do I merge repo-a to repo-b , and vice versa. Is it possible? * If it's possible, can we make repo-a collaborators do not show up on repo-b , and vice versa? The idea is to keep the confidentiality of the

Local Git branch has diverged from origin following an interactive rebase

烈酒焚心 提交于 2019-12-07 14:37:51
问题 I have a local branch ( CRM-ayrshireminis ) that has a couple of commits on it that I have pushed to the origin ( origin/CRM-ayrshireminis ). This branch was created from the develop branch about one week ago, on which there have been one weeks worth of work from other collaborators. What I want to do is rebase the latest code from origin/develop into my feature branch CRM-ayrshireminis . What I done was: git checkout develop git pull git rebase -i develop CRM-ayrshireminis I had two commits,

Git Merge - Binary File Conflict Resolution

流过昼夜 提交于 2019-12-07 14:24:43
问题 How do I resolve a binary file conflict resolution during a merge operation in git? Here's what I've done so far: git checkout master git fetch origin git merge working_branch ... [Conflicts] ... git status ... Unmerged paths: both modified: Path/file.dll ... I want to keep the version in the working_branch and discard the version in the master . How do I do this? 回答1: Figured it out earlier today: git checkout --theirs Path/file.dll git add Path/file.dll git commit -m "Resolved merge

Three commit references when merging submodules

喜夏-厌秋 提交于 2019-12-07 03:16:26
I am merging a branch in a project that uses git submodules. Usually when there is a conflict there are two sets of changes, theirs and ours. Resolving the conflicts is about merging these two into one. But I noticed that for git submodules the diff shows a third value: diff --cc my_submodule index dd7404e,e6753b1..0000000 --- a/my_submodule +++ b/my_submodule @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit dd7404e5f35ee0b0064f0d6ed8201cc39d6ed6b2 -Subproject commit e6753b1142cf0350608720ff23f7ecf51b813cd9 ++Subproject commit 3b4e75fbb7c55cf21e19509bbbbfabfa1fc10630 What do the "- ", " -" and "++'

git added by them renaming conflict - git recognises the same files in the renamed directory as new files

穿精又带淫゛_ 提交于 2019-12-07 03:07:38
I've renamed a directory and merged it into my main branch, when merging another branch, git recognises the same files in the renamed directory as new files. I get the merge conflict 'added by them' for the same files in that directory when merging in another's branch: added by them: theirDir/same_file_name.xxx I've renamed the directory in their branch to match and continue to get the 'added by them' conflict. When I try to checkout --ours I get $ git checkout dir/same_file_name.xxx --ours error: path 'dir/same_file_name.xxx' does not have our version At this point deleting this file actually