git-merge

How to interactively (visually) resolve conflicts in SourceTree / git

≡放荡痞女 提交于 2019-12-18 09:59:06
问题 I'm using (Windows) SourceTree for my git project. I can do it in either command prompt or Linux terminal. But, I'm wondering whether there is a nice way to interactively and visually resolve conflicts. For example, if pull detects conflicts, popping up a GUI-based conflict tool (e.g., P4Merge). Is it possible? I am always doing manual conflict resolving, which is just painful. This is, for example, a git pull message, from SourceTree. git -c diff.mnemonicprefix=false -c core.quotepath=false

How to create a GitLab merge request via command line

别说谁变了你拦得住时间么 提交于 2019-12-17 23:16:35
问题 We are working on integrating GitLab (enterprise edition) in our tooling, but one thing that is still on our wishlist is to create a merge request in GitLab via a command line (or batchfile or similar, for that matter). We would like to integrate this in our tooling. Searching here and on the web lead me to believe that this is not possible with native GitLab, but that we need additional tooling for that. Am I correct? And what kind of tooling would I want to use for this? 回答1: It's not

Why did Git create a merge commit with no file changes?

。_饼干妹妹 提交于 2019-12-17 22:38:12
问题 I am collaboratively working on a project with someone, so we decided to use git. Unfortunately, we frequently code in locations with no internet, so we end up with something like this: origin/master: A---B---C \ mylocalmaster: D---E---F \ hismaster: G---H---I Now, say he pushes his commits and gets this: origin/master: A---B---C---G---H---I \ master (local): D---E---F All I want to do is push my commits to get this in both my local repo and the online one: A---B---C---D---E---F---G---H---I

The following untracked working tree files would be overwritten by merge, but I don't care

丶灬走出姿态 提交于 2019-12-17 21:38:03
问题 On my branch I had some files in .gitignore On a different branch those files are not. I want to merge the different branch into mine, and I don't care if those files are no longer ignored or not. Unfortunately I get this: The following untracked working tree files would be overwritten by merge How would I modify my pull command to overwrite those files, without me having to find, move or delete those files myself? 回答1: The problem is that you are not tracking the files locally but identical

GIT merge -keep specific parts of one branch and everything else of the other

筅森魡賤 提交于 2019-12-17 20:14:12
问题 Here's the scenario Master branch -File name: xxx-master.txt -File content: code code ID=01 code code code Dev branch -File name: xxx-dev.txt -File content: code code ID=02 code code code When merging master into dev, I'd like to keep xxx-dev.txt as the file name and ID=02, but everything else from master. And vice versa when merging dev into master. Is that something I can make GIT understand? 回答1: This is typically a case where you need to keep (for a given file, here xxx-dev.txt )

git checkout --ours does not remove files from unmerged files list

*爱你&永不变心* 提交于 2019-12-17 17:31:51
问题 Hi I need to merge two branches like this. This is just an example what is happening, I work with hundreds of files which need resolution. git merge branch1 ...conflicts... git status .... # Unmerged paths: # (use "git add/rm <file>..." as appropriate to mark resolution) # # both added: file1 # both added: file2 # both added: file3 # both added: file4 git checkout --ours file1 git chechout --theirs file2 git checkout --ours file3 git chechout --theirs file4 git commit -a -m "this should work"

Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch

二次信任 提交于 2019-12-17 17:18:03
问题 I am using Git. I did a pull from a remote repo and got an error message: "please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch." I try to type a message and press Enter but nothing happens. How do I tell Git/terminal I am done typing in my message? I am using terminal on OS X. 回答1: It's not a Git error message, it's the editor as git uses your default editor. To solve this: press "i" write your merge message

git merge, keep both

一个人想着一个人 提交于 2019-12-17 10:58:31
问题 For merging I use this to "keep mine" git merge -X ours foo and this for "keep theirs" git merge -X theirs foo However on my latest merge it looks best to keep both sides. Does Git have a "strategy" for this, to avoid manually editing the file? 回答1: There is no 'merge strategy' for resolving these conflicts. However, if you truly want a conflict like: <<<< ours Foo ========= Bar >>>> theirs to resolve to Foo Bar then you can configure the 'merge driver'. From the gitattributes man page: union

GIT: How can I prevent foxtrot merges in my 'master' branch?

拈花ヽ惹草 提交于 2019-12-17 01:00:32
问题 A foxtrot merge is a merge where 'origin/master' merges in as a 2nd (or later) parent, like so: Commit 'D' is a foxtrot merge because 'origin/master' is its 2nd parent. Notice how first-parent history from 'origin/master' contains commit 'B' at this moment. But in my git repo I need all merges involving 'origin/master' to keep 'origin/master' as the 1st parent. Unfortunately git doesn't care about parent-order when it evaluates whether a commit is eligible for fast-forward. This causes the

.gitignore and “The following untracked working tree files would be overwritten by checkout”

房东的猫 提交于 2019-12-17 00:23:04
问题 So I added a folder to my .gitignore file. Once I do a git status it tells me # On branch latest nothing to commit (working directory clean) However, when I try to change branches I get the following: My-MacBook-Pro:webapp marcamillion$ git checkout develop error: The following untracked working tree files would be overwritten by checkout: public/system/images/9/thumb/red-stripe.jpg public/system/images/9/original/red-stripe.jpg public/system/images/8/thumb/red-stripe-red.jpg public/system