git-merge

can't push to branch after rebase

痞子三分冷 提交于 2019-12-04 07:20:04
问题 We use git and have a master branch and developer branches. I need to add a new feature and then rebase the commits to master, then push master to CI server. The problem is that if I have conflicts during rebase I cannot push to my remote developer branch (on Github) after the rebase is complete, until I pull my remote branch. This causes duplicate commits. When there are no conflicts, works as expected. question: after rebase and conflict resolution, how do I sync up my local and remote

How to retrieve branch names in a custom Git merge driver?

假装没事ソ 提交于 2019-12-04 04:41:31
I'm writing a custom merge driver that needs to be aware of the names of the branches it is merging. I managed to retrieve the name of the branch being merged into (destination) with git symbolic-ref HEAD and the name of the branch being merged in (source) from the GITHEAD_<SHA> environment variable. # retrieve merged branch name from an env var GITHEAD_<sha>=<branchName> # we cannot use a sym ref of MERGE_HEAD, as it doesn't yet exist gitHead=$(env | grep GITHEAD) # e.g. GITHEAD_<sha>=release/1.43 # cut out everything up to the last "=" sign source="${gitHead##*=}" # retrieve base branch name

How to merge files from one branch's directory into another branch?

孤街浪徒 提交于 2019-12-04 04:28:23
Simple example. This is 'master': root - index.html - readme.md This is a branch called 'dev': root src - index.jade dist - index.html I'd like to take the index.html file (or all files, really) in the 'dist' folder of the 'dev' branch and replace or merge it with the one in the root directory of my master branch. I've tried, from master: git checkout dev dist/ But it produces this result: root dist - index.html - index.html Clearly not what I want. Is git capable of doing what I want it to do or will I just have to whip up a script? Thanks! This can be accomplished using the subtree merge

Changing git conflict markers

爱⌒轻易说出口 提交于 2019-12-04 04:16:25
Is it possible to change the conflict markers to something user defined? Motivation: It has happened several times to me that, due to hasty and not very careful merging of several branches, there are some left over merge tags in my LaTeX document. With most programming projects these tags would result in an syntax error and therefore I would spot them. However, in Latex the <<<<, ==== and >>>> tags are just compiled into some other character sequences without any warning. To remedy this I would like to change these conflict markers into something that doesn't compile, or at leasts make them

gitattributes not setting merge driver correctly

你。 提交于 2019-12-04 03:54:30
I have the following directory structure: project/ .git/ ... app/ ... config/ initializers/ braintree.rb environments/ production.rb .gitattributes My project uses two main branches, master and staging, each tracking a different remote (production and staging heroku apps). The idea is that the staging branch moves forward with new features, they get pushed to and tested on the staging remote, then master is fast-forwarded to match staging and pushed to the production remote. Here's what I want to do: freely merge these two branches while keeping their versions of braintree.rb and production.rb

Git merge conflicts when no changes done

ぃ、小莉子 提交于 2019-12-04 03:26:06
I've cloned a repo and then, after a few hours, I've made 'git pull'. However merge conflicts appeared and I don't understand why because I haven't made any change into cloned repo. git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean git pull remote: Counting objects: 6211, done. remote: Compressing objects: 100% (849/849), done. remote: Total 3237 (delta 2756), reused 2846 (delta 2371) Receiving objects: 100% (3237/3237), 865.51 KiB | 152.00 KiB/s, done. Resolving deltas: 100% (2756/2756), completed with 867 local objects.

git .BACKUP .BASE .LOCAL .REMOTE files

[亡魂溺海] 提交于 2019-12-04 00:19:38
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.16908.shtml I also have another set of the files above but ending in .21384, assuming from another merge

Differences between git fetch and git fetch origin master

那年仲夏 提交于 2019-12-03 23:27:09
问题 I was doing a fetch/merge and wanted to know if there is any difference between doing git fetch and git fetch origin master I do not have any other branches and origin points to my remote repository on GitHub. When I do: git fetch origin master remote: Counting objects: 4, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From github.com:XXXXXXXXXXXXXXX * branch master -> FETCH_HEAD But just: git fetch From

Git Development vs Release branch best practices

徘徊边缘 提交于 2019-12-03 21:22:42
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 with specific functionality implemented and verified, and hence we exactly know what's going in the

TortoiseGit / Winforms: Resolving Resource.resx When Merging

一世执手 提交于 2019-12-03 20:21:30
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? This is an old question that has not been answered. However resolving conflicts in resx files is driving me nuts. The main issue seems to be that resx files can be