git-merge

git merge conflict due to moved files

半城伤御伤魂 提交于 2019-12-05 21:57:01
I have not done so much with git so far. Now, I have the following problem. While I did some local modifications and commits, my colleague restructured files and folders within a new branch. Then, I added a remote tracking branch (reflecting his changes) and tried to merge my modifications into it. Of course it fails as the files moved to another location. How can I go onwards? A 'git status' shows me this: # On branch develop # You have unmerged paths. # (fix conflicts and run "git commit") # # Unmerged paths: # (use "git add/rm <file>..." as appropriate to mark resolution) # # deleted by us:

Can Git merge --squash preserve commit comments?

旧巷老猫 提交于 2019-12-05 21:04:41
Is there a way of automatically adding all the commit comments from the squashed mybranch commits when doing a git merge --squash mybranch so that the single commit contains a concatenation of all the commit comments from mybranch I think that's what "git merge --squash" does automatically! Just do the commit with "git commit --no-edit" and I think that's what you'll get. I see all the commit messages inside .git/SQUASH_MSG immediately after I run the "git merge --squash" command. Do you? Personally, I squash into master, but then force-push the result back to my topic branch. This way my

Local Git branch has diverged from origin following an interactive rebase

你。 提交于 2019-12-05 18:21:21
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, so I squashed them into one and then quit out. I got the message saying Rebasing (2/2) , so it seemed

Why can’t you merge in a bare git repo?

寵の児 提交于 2019-12-05 13:26:28
Why can’t I merge into a bare repo? Bare repos don’t have a HEAD or a working tree. In the config file we can see bare=true . You also can’t pull in a bare repo (because pull = fetch & merge and merge doesn't work). However, you can push to a bare repo – why? As far as I know, push also contains a merge, but in this case we can do it well. So, the question could be “how does git merge work?”. Why does it need a HEAD ? What is it doing when merging? As Chronial points out , pushing does fast-forward merges or forced updates, which just moves references/branch pointers to a different commit. In

git .BACKUP .BASE .LOCAL .REMOTE files

两盒软妹~` 提交于 2019-12-05 13:20:06
问题 We're getting git installed here at work for a project and I'm playing around with it with another co-worker. I've been resolving some choreographed merge conflicts but I'm ending up with a bunch of extra files I don't want. They are .BACKUP .BASE, .LOCAL and .REMOTE files. Based on those names, they seem to be coming from resolving my merges. Some exact file names I'm getting are: index.shtml.BACKUP.16908.shtml index.shtml.BASE.16908.shtml index.shtml.LOCAL.16908.shtml index.shtml.REMOTE

Git Development vs Release branch best practices

戏子无情 提交于 2019-12-05 04:48:31
问题 I have been monitoring two branches starting from each sprint - Release and Master . Master branch is from where developers create new branch(task specific), implement their changes, and creates pull request which gets merged into the Master. Release branch is sprint specific which remains always submittable to the production. We only merge branches committed to the Master and verified by the QA into Release branch. This approach works best for us as we submit Release at fix regular interval

How to revert a merge which used strategy=ours?

陌路散爱 提交于 2019-12-05 02:50:11
I'm working with a repository where a merge was performed weeks ago which we just discovered used the --strategy=ours flag (it was supposed to use the --strategy-option=ours flag), thus not applying any changes to HEAD. However, we need to have the changes applied. Git already recognizes the branch as being merged and the commits in the history of the branch. This sort of merge can't be reverted using git revert -m ... What would be the proper way of reverting and/or re-applying the merge to change the files? master A - B - E - F - G ---> L - M - N \ / topic C - D Merge commit (F) would be the

How do I change a commit message after a 'git-pull' auto-merge?

最后都变了- 提交于 2019-12-05 02:39:48
问题 Occasionally, my collaborators will "panic" when there is an automatic merge generated as the result a git-pull , and just accept the default commit message. Before this commit gets pushed, I want to be sure the message gets fixed, but --amend seems not to work. What is the best way to fix the message that's generated in this scenario. The best instructions I can come up with for them are git reset --soft HEAD~ git merge -m <message> <the tracked remote branch> but that seems a bit scary (

Remerge after reverting failed merge

心已入冬 提交于 2019-12-05 02:09:19
问题 I have two branches in repository: feature and master . I have merged master into feature and pushed result to remote feature branch: git merge master because it contains necessary changes of external interfaces. Than I have discovered that merge conflicts were resolved wrong and I have reverted this merge with: git revert -n -m 1 78e7ebfa8237 So I'm back on feature not merged. But according to history merge already happened and feature branch already contains necessary changes. Can I try

TortoiseGit / Winforms: Resolving Resource.resx When Merging

心不动则不痛 提交于 2019-12-05 01:44:05
问题 I am fairly new to TortoiseGit. Wondering, if I get a conflict on a .resx file, how do I resolve it during a merge? For example, I could select "using theirs" off of the menu, try to do a pull and push, but is this the right approach? Can I somehow use theirs and rebuild it with my project changes? The differences (as well as mixed up contents compared to the respository) are many - to many to do a real merge. Thanks for looking? 回答1: This is an old question that has not been answered.