git-merge

Does a rebase the only way to fix a wrong cherry-pick?

♀尐吖头ヾ 提交于 2021-02-08 06:44:26
问题 The branch #1 contains a bug fix C1. The branch #2 first cherry-pick ed C1, then the branch #2 owner realised the work done in C1 was wrong actually, so he committed the correct fix C2. In C2 he basically removed the change in C1, replaced with the correct change. When the branch #1 owner wants to "pick-up" the fix, the merge won't work . Because with merge the result C3 will then contain C1 and the correct fix introduced in C2, i.e. C1 will be keep by merge. Because the branch #2 now does

Exclude certain file patterns from rename detection in git?

独自空忆成欢 提交于 2021-02-08 06:35:59
问题 Question Is it possible to exclude certain file patters from rename detection when doing merges with git? Background With our system, Salesforce.com, some metadata files are exactly identical, except for name. Because of this (I believe) merges can get a bunch of conflicts, e.g. if a meta file was deleted in one branch, and a different meta file with an identical body is deleted in another, it sees things as a rename and conflict with one added on deleted. I know I can tweak the sensitivity

How to move a subdirectory from a branch in one git repository to a branch in a different repository, preserving history?

*爱你&永不变心* 提交于 2021-02-08 03:39:27
问题 I've got a directory containing utility libraries that were developed in a branch in one git repository, but it turns out they really belong in a different directory in a different project. I've read through and attempted Greg Bayer's Moving Files from one Git Repository to Another, Preserving History multiple times, but I'm unable to preserve history. I'm attempting to do this all under non-master branches to be more safe as the project is not ready to merge back to master yet anyway. Here's

Git: Subtree Merge into a Deeply Nested Subdirectory?

丶灬走出姿态 提交于 2021-02-06 09:53:06
问题 I'm attempting to use git's subtree merge stategy where the subdirectory into which I want to merge is nested fairly deeply - currently four levels deep. I followed the directions here to add the module repository as a remote, run git read-tree to get the remote code into a subdirectory in my local repo, and commit those changes. My problem comes when I try to pull and merge changes from the remote into the master branch of my main project. Step 5 at the page above suggests a git pull with

Git: Subtree Merge into a Deeply Nested Subdirectory?

匆匆过客 提交于 2021-02-06 09:52:33
问题 I'm attempting to use git's subtree merge stategy where the subdirectory into which I want to merge is nested fairly deeply - currently four levels deep. I followed the directions here to add the module repository as a remote, run git read-tree to get the remote code into a subdirectory in my local repo, and commit those changes. My problem comes when I try to pull and merge changes from the remote into the master branch of my main project. Step 5 at the page above suggests a git pull with

Convert merge into rebase without having to perform the merge again

我的梦境 提交于 2021-02-05 18:29:00
问题 I made a mistake: I should have used git pull --rebase , but I issued a simple git pull , merged everything and now have a merge commit at the HEAD of my branch. I want to get rid of that merge commit and I thought I'd just issue a git rebase -i HEAD~3 , move my last local commit to the top and squash the merge commit into it. Alas, the merge commit is not available for squashing. If I do this, I get into intermediate states where I need to do the merge again, which is a lot of work. Is there

Convert merge into rebase without having to perform the merge again

烂漫一生 提交于 2021-02-05 18:09:20
问题 I made a mistake: I should have used git pull --rebase , but I issued a simple git pull , merged everything and now have a merge commit at the HEAD of my branch. I want to get rid of that merge commit and I thought I'd just issue a git rebase -i HEAD~3 , move my last local commit to the top and squash the merge commit into it. Alas, the merge commit is not available for squashing. If I do this, I get into intermediate states where I need to do the merge again, which is a lot of work. Is there

Convert merge into rebase without having to perform the merge again

北城余情 提交于 2021-02-05 18:08:03
问题 I made a mistake: I should have used git pull --rebase , but I issued a simple git pull , merged everything and now have a merge commit at the HEAD of my branch. I want to get rid of that merge commit and I thought I'd just issue a git rebase -i HEAD~3 , move my last local commit to the top and squash the merge commit into it. Alas, the merge commit is not available for squashing. If I do this, I get into intermediate states where I need to do the merge again, which is a lot of work. Is there

Convert merge into rebase without having to perform the merge again

耗尽温柔 提交于 2021-02-05 18:06:08
问题 I made a mistake: I should have used git pull --rebase , but I issued a simple git pull , merged everything and now have a merge commit at the HEAD of my branch. I want to get rid of that merge commit and I thought I'd just issue a git rebase -i HEAD~3 , move my last local commit to the top and squash the merge commit into it. Alas, the merge commit is not available for squashing. If I do this, I get into intermediate states where I need to do the merge again, which is a lot of work. Is there

avoid auto merging of git conflicts and warn if same files getting modified in different branches

扶醉桌前 提交于 2021-01-29 09:12:16
问题 Usually when we merge feature branch with master or any other branch and if same file is modified in different branches but on different lines then GIT does resolve the conflict automatically. We dont want these merge happened automatically and expecting GIT should warn us with list of common files modified in two branches to be merged. e.g. In Master, we have file test1.txt as below AAA BBB Feature branch (feature/test1) created out of master and updated file test1.txt AAA BBB CCC also added