git-merge

Is it possible to do a partial merge with --ff-only changes?

瘦欲@ 提交于 2019-12-06 05:55:06
I have a local branch that needs to be merged with the remote. Both remote and local branches have lots of different commits (on various files). Is it possible to identify and merge the files which have only fast-forward type (remote-side) changes? I would like to deal with all the other changes manually. git merge --ff-only does not merge anything when there is any two-sided changes. Edit: I would like to make the question more clear. Let's say the original files (on parent node) are file1, file2, file3, file4. My local branch, I modified file1, file2, deleted file4, added file5. In their

bitbucket unable to merge, this field is required

坚强是说给别人听的谎言 提交于 2019-12-06 05:50:20
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: From bitbucket site follow these steps: Go to Compare Select Destination and Source branches Select Compare button Select Merge button on top right corner This error was a result of a bug that has now been fixed. 来源: https://stackoverflow.com/questions/42533093/bitbucket-unable-to-merge-this-field-is-required

Getting merged code “right” with Git

谁都会走 提交于 2019-12-06 05:43:40
问题 I've just overwritten my co-workers code by merging FETCH_HEAD and getting my more recent changes instead of his. I want to revert to before the merge, then do the merge forcing his changes to be accepted where he touched the file, but getting my merges where there isn't any other changes. My git log (created with l2*) looks like this now : * 3f6308d - (HEAD, master) Merging changes (confliect in PriceListForm.java.. was a formatting change only (Sun Dec 29 09:07:27 2013) <Gre |\ | * 283c00c

GIT Pull deleted my commit

荒凉一梦 提交于 2019-12-06 04:54:44
问题 After git pull I have done git reset hard to undo the merge with commit id before merge.Somehow my entire commit is gone and I cant the see the commit in history also. But I have the commit id , on git show command I can see my changes. How can I get back my changes and how to track what mistake I have done 回答1: if you have the commit hash, and you have not run garbage collection, you can always go back to that commit with git checkout <sha1> . if you want to re-apply it on top of your

Merge 2 Different git Repos

别等时光非礼了梦想. 提交于 2019-12-06 03:47:10
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 repo collaborators. Thanks. Submodules are not the best for frequent commits. In my project I use git

Git bi-directional merging

£可爱£侵袭症+ 提交于 2019-12-06 03:32:38
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) Question: What is the best way to get these specific commits from b up to a, with the intent of keeping

Git Merge - Binary File Conflict Resolution

北战南征 提交于 2019-12-06 03:04:26
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? Figured it out earlier today: git checkout --theirs Path/file.dll git add Path/file.dll git commit -m "Resolved merge conflict by checking out file from working_branch and adding it to the master" 来源: https://stackoverflow.com

Merge using EGit results in commit of all changes as done by the merger

心不动则不痛 提交于 2019-12-06 02:40:12
I'm using Eclipse with EGit and and my origin/master is on github. On this project are working 3 programmers. When I pull changes to my local git (using EGit) and there are conflicts I solve them, no problem. The thing is that when I commit, it commits a merge that includes all the changed files since my last commit (before pull) and in git I see all these changes by other programmers as if done by me on this last commit of the merge... Why does this happen? What am I doing wrong? Update (14.10.2012): Thanks to @robinst I managed to correctly commit a correct merge with only the merged files.

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

独自空忆成欢 提交于 2019-12-05 23:41:09
问题 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>

Can I merge only non-conflicting changes in Git?

守給你的承諾、 提交于 2019-12-05 23:31:32
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-? 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-non-conflicting-changes-in-git