git-rebase

How do I rebase while skipping a particular commit?

假装没事ソ 提交于 2019-12-04 15:42:24
问题 Is there a way to rebase a branch onto another while skipping a particular (conflicting) commit on the other branch? For example, I want to rebase mybranch onto master , but master contains a commit that will conflict with the commits in master, so I prefer to undo that commit completely. -o-o-o-o-o-x-o-o-o-o master | o-o-o-o mybranch x marks the conflicting commit. 回答1: Use interactive rebase: git rebase -i master An editor will open and you will have a list of commits like this: pick

Conflict resolution or conflict avoidance in GIT?

*爱你&永不变心* 提交于 2019-12-04 14:02:13
Questions : How are several people meant to work with GIT? Is update-commit usual as in SVN or is merge the default? When merging, who should appear as the author of the merging commit? A lot of background information : I am writing a paper on LaTeX with another guy and we are using GIT for the version control. From the start we decided we both would work on the master branch, because we are anyway only two people. I've done a number of commits. Then he did a commit over an old version and merged my last version and the most recent one (after his commit). This is easier to see with a picture:

git: changing an old commit message without creating conflicts

南楼画角 提交于 2019-12-04 13:42:20
问题 I want to change a pretty old commit message using: git rebase -i sha1-of-commit^ That's nice, I do git commit --amend and edit the message, but things get bad when I do: git rebase --continue I encounter multiple conflicts but don't understand why as the whole conflict resolution has obviously already been done in the past, and git should just move forward until all commits are rebased. How can I finish the rebase quickly without having to handle these old conflicts? I just want to change a

Empty commits removed after interactive rebase, even though --keep-empty is used

梦想与她 提交于 2019-12-04 11:27:09
I have some trouble using the --keep-empty option of git rebase , and I'm not sure whether I'm misunderstanding what this option does, or there's a bug. Here is a minimal example: Setup Create a new Git repository and an initial, unrelated commit. $ git init $ echo something >base.txt $ git add base.txt $ git commit -m 'some base commit to not run into the root corner case' Create a new commit which adds two new files. $ echo A >a.txt; echo B >b.txt $ git add a.txt b.txt $ git commit -m 'add A and B' Modify one of the files. $ echo A1 >a.txt $ git add a.txt $ git commit -m 'change A' Modify

Difference between git pull --rebase and git pull --ff-only

£可爱£侵袭症+ 提交于 2019-12-04 07:29:51
问题 Let's say origin/master has commit A--B--C and my local/master has commit A--B--D . What will happen if I use git pull --rebase ? What will happen if I use git pull --ff-only ? Is there any difference in the resulting commit tree ? 回答1: What will happen if I use git pull --rebase ? git pull --rebase is roughly equivalent to git fetch git rebase origin/master i.e. your remote changes ( C ) will be applied before the local changes ( D ), resulting in the following tree A -- B -- C -- D What

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 explain “git pull --rebase” in simple terms?

筅森魡賤 提交于 2019-12-04 04:11:43
I think I understand git pull and this is how I explain it in, what I call, "simple terms": Generally speaking, git pull is about merging a "remote" branch into a "local" branch. In more detail, git uses the content of the "remote" branch to "update" / "modify" content of the "local" branch. In even more detail, if a file has been modified in the "local" branch but not in the "remote" branch, then after the merge, the content of the file will be the same as the content in the "local" branch. The opposite is also true. If a file was modified on the "remote" branch but not in the "local" branch,

Cannot pull with rebase

廉价感情. 提交于 2019-12-04 03:04:20
I get this message: Cannot pull with rebase: You have unstaged changes. Please commit or stash them. Yes, I have changes which are not committed. I searched a way to rebase my uncommitted changes on top of the new code which I would get from a pull. I found this: https://github.com/aanand/git-up I want to know if this is still the way to go, or if there are more modern ways to go. I use git version 1.8.1 git-up is probably the more sophisticated way to solve this issue. Otherwise, you need to stash, rebase and stash pop. The "more modern way" will be available in git 1.8.5 (or 1.9, Q4 2013).

Show diff when writing commit messages during an interactive rebase

本秂侑毒 提交于 2019-12-04 01:54:58
When doing a regular git commit, git commit --verbose shows the diff in the text editor when writing the commit message. Suppose I am doing an interactive rebase ( git rebase --interactive ) to edit previous commits. To 'continue' rebasing, I run git rebase --continue . This opens a text editor for editing the commit message, but it does not show the diff. After making changes to a commit, how can I display the diff when (re)writing the commit message during an interactive rebase? git rebase --continue --verbose doesn't seem like a valid command... To show the diff: git -c commit.verbose=true

GIT Rebase Fatal on Multiple 0.5GB Binary Files

柔情痞子 提交于 2019-12-04 00:53:01
[This question is essentially reopening git crash during rebase which never had an answer] I'm attempting to a rebase from my 'secc' branch as: $ git rebase main First, rewinding head to replay your work on top of it... fatal: Out of memory, malloc failed (tried to allocate 553656577 bytes) # about 0.5 GB $ git rebase --abort No rebase in progress? The failure is related to the fact that both branches and their common ancestor have three .dat files each of which is 0.5 GB. How can I do a rebase in this situation? Additional info: A 'git merge main' works just fine. Augmenting .gitattributes