git-merge

Git rebase after merge confused about deleted file

前提是你 提交于 2019-12-10 03:54:33
问题 My Git repository has two files, alpha and beta , with identical content. If I delete alpha in my master branch, and edit it in my feature branch, then when I merge master into feature, I'm warned about a conflict. Assume I resolve this by deleting alpha . If I then rebase my feature branch onto master using git rebase master , alpha is deleted, but the changes I made to alpha on the feature branch are now applied to beta ! I get a conflict warning but it's happily resolved with an auto-merge

git blame: correct author after merge

人盡茶涼 提交于 2019-12-10 02:19:11
问题 A GIT merge introduces a new commit. This causes problems with "git blame": the merged lines appear to be committed by the developer that did the merge. I can understand this being the case for conflicting changes (because he solved the conflicts). But is there a way to not have this happening for non-conflicting lines? Some option to "git blame"? If there is no way around, this would basically make "git blame" almost useless when you have a lot of merges - and GIT encourages a lot of merges.

What is a trivial merge in git?

痴心易碎 提交于 2019-12-10 01:36:48
问题 Sometimes when I do a pull instead of a rebase after a simple one file change commit I see the following in the master log: Trivial merge But there's no diff of what changed? What's the point of this log message? Did anything change I don't know of? It scares me. 回答1: git doesn't insert this message into the log at any point. I'm going to take a wild guess and assume that you've seen this message in gitweb. gitweb prints this message if there is no output from a combined diff. This happens

git - how to get the full message from git merge --log

依然范特西╮ 提交于 2019-12-09 18:24:17
问题 After using git merge --log --no-ff --no-commit or git merge --log --squash , a long commit message is created. But the message is cut i.e ... at the end and does not list all commits. How do I get the full message? I checked the files in .git/MERGE_HEAD and .git/SQUASH_HEAD and it also contains the short message with ... Thanks 回答1: Note that the --log option is actually --log<=n> (from git merge): In addition to branch names, populate the log message with one-line descriptions from at most

Changing git conflict markers

依然范特西╮ 提交于 2019-12-09 16:24:03
问题 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

Best practices on GitHub repos, to Fork or create a New Branch

China☆狼群 提交于 2019-12-09 08:54:49
问题 I'm looking for the best practice, forking vs branching on GitHub. I've read this Forking vs. Branching in GitHub, but it's not relevant. Our team of 5 people are working on the same repository, and we would like to avoid merging problems, conflicts or regression in the code. The goal is for the 5 persons to work on different parts of the project, often on the same file. I would like to know if it's worth it to : fork the project, work and create pull requests, so each persons can review the

Git merge ignore spaces [duplicate]

混江龙づ霸主 提交于 2019-12-09 02:46:41
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: git whitespace woes How can I setup get to not report conflicts purely due to whitespace on a merge, like the following ? <<<<<<< HEAD open RESDBFILE, "< $this_day_result_file_"; while ( my $resdbline_ = <RESDBFILE> ) { my @rwords_ = split ' ', $resdbline_; if ( exists $uncaliberated_strategies_{$rwords_[0]} ) { # if this strategy_filename_base was there in @strategy_filevec_ delete $uncaliberated_strategies_{

Which commits am I currently merging?

℡╲_俬逩灬. 提交于 2019-12-09 00:48:36
问题 When I execute git merge , no new commit are created yet (because of conflicts or --no-commit option), how to check which branch I am merging? git status shows only current branch. 回答1: A git merge that has stopped due to conflicts leaves two 1 files with information about what is being merged: .git/MERGE_HEAD .git/MERGE_MSG (replace .git with the output of git rev-parse --git-dir if needed, e.g., if you're in a sub-directory within the git directory). The contents of MERGE_HEAD is the other

What is a merge request?

一笑奈何 提交于 2019-12-08 16:09:17
问题 On services offering cloud Git repositories, I always find merge requests. What is its purpose? Who was supposed to create it? Also, what+s the lifecycle of a merge request? Someone creates it, and then - what cycles it should pass? 回答1: Merge Request and Pull request basically refers to same thing. Tools such as GitHub and Bitbucket choose the name pull request since the first manual action would be to pull the feature branch. Tools such as GitLab and Gitorious choose the name merge request

What is wrong with merge commits?

删除回忆录丶 提交于 2019-12-08 15:53:47
问题 I see a lot of questions where people are asking how that can avoid "pointless" merge commits. What exactly is bad about a merge commit? I find them useful, as you can see exactly where two developers started working, and where there work is merged together. It seems like rebasing, as a lot of answers suggest doing, destroys this information and you lose a lot of the project's history. Is there something I am missing that makes a merge commit undesirable? 回答1: There are two different kind of