rebase

Mercurial: Concrete examples of issues using hg pull --rebase

╄→尐↘猪︶ㄣ 提交于 2019-12-04 14:54:16
I'm struggling to find the mercurial workflow that fits the way that we work. I'm currently favouring a clone per feature but that is quite a change in mindset moving from Subversion. We'll also have issues with the current expense we have in setting up environments. Using hg pull --rebase seems to give us more of a Subversion-like workflow but from reading around I'm wary of using it. I think I understand the concepts and I can see that rewriting the history is not ideal but I can't seem to come up with any scenarios which I personally would consider unacceptable. I'd like to know what are

How to manage a Git “upstream” branch and related patches?

守給你的承諾、 提交于 2019-12-04 14:10:23
问题 Recently I had an issue where I was given a patch for an assignment, as the professor had changed the code to add new functionality. Unfortunately, I had already put the original codebase in git and had made lots of changes and commits already. The workflow I used to apply the patch is as follows: git checkout <hash_of_where_patch_should_go> git checkout -b patch_branch git apply patch git add ./* && git commit -m "applying patch" git rebase master patch_branch //Fix merge conflicts git

Understanding “git pull --rebase” vs “git rebase”

五迷三道 提交于 2019-12-04 11:58:20
问题 According to my understanding of git pull --rebase origin master , it should be the equivalent of running the following commands: (from branch master): $ git fetch origin (from branch master): $ git rebase origin/master I seem to have found some case where this doesn't work as expected. In my workspace, I have the following setup: branch origin/master references branch master on remote origin branch master is set up to track origin/master , and is behind master by several commits. branch

Undo a git rebase using onto

你。 提交于 2019-12-04 11:20:00
问题 I rebased my branch version2 against master using: git rebase --onto master version1 version2 How can I undo this? To undo it I did git reflog Currently, git status (on version2 ) gives me : Your branch and 'origin/version2' have diverged, and have 2563 and 222 different commits each, respectively. nothing to commit (working directory clean) I want to undo this rebase. 回答1: Assuming you haven't modified the version2 branch since you rebased it, all you need to do is a hard reset of the branch

How can two branches be combined into a single branch based on the date of each commit?

你。 提交于 2019-12-04 10:05:05
Let's say I have a git repository that looks like this: merge-base---A1--A2------A3------A4 (branchA) \ ----------B1------B2 (branchB) To make things simpler, let's say the commits on branchA are strictly modifications to fileA, and the commits on branchB are strictly modifications to fileB. I want to combine these branches into a third branch, branchAB, where the commits will be ordered by date: merge-base---A1--A2------A3------A4 (branchA) \ ----------B1------B2 (branchB) \ A1--A2--B1--A3--B2--A4 (branchAB) Is there a way to automatically do this with a single git command, or am I stuck with

When would one need git-rebase?

半腔热情 提交于 2019-12-04 08:35:47
问题 Everytime I read the git-rebase documentation, I get lost. It feels to me like a kind of a low-level operation (read: dark magic). Quoting the docs: Assume the following history exists and the current branch is "topic": A---B---C topic / D---E---F---G master From this point, the result of either of the following commands: git rebase master git rebase master topic would be: A'--B'--C' topic / D---E---F---G master The question is: Why would anyone want to do such a thing? For one thing, it

How can I rebase a commit made by another author without adding myself as the committer?

别等时光非礼了梦想. 提交于 2019-12-04 08:03:45
问题 Normally, when you rebase another author's commit with git, git adds a Commit: header with your name and email address. I have a situation where I don't want this to happen. I want the rebased commit to end up with the same SHA1 as it would have if the original author had done the equivalent rebase him/herself. Is this possible? 回答1: All git commits have a committer field internally; you can see this by typing git cat-file commit HEAD immediately after committing something. As such you cannot

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

Can I safely rebase one branch into other and then to master?

这一生的挚爱 提交于 2019-12-04 06:29:01
问题 I have to development branches and I found branch B depending on code from branch A . I want to rebase A into B so I can keep on developing B . Soon A will be merged to master (before B ), but not now. Then, when I merge B , will it break the reference from having A rebased on it? Can I just then rebase B on master and all will be fine or do I need to do any special step? 回答1: Note that git (and pretty much all other version control systems) calls this rebasing on to, not in to. You may

Reparenting in Mercurial: how does one bring two independent svn clones back together?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 05:56:47
Here's the situation: developer Foo created a hg repo from our svn repo. Foo's hg repo was only a shallow clone of the trunk in svn (no svn branches, tags, etc. and the history was incomplete [about 100 changesets]). Developer Bar did the same thing, but cloned the entire svn repo including the entire history, branches, tags, etc. Both Foo and Bar have done branchy development on their repositories. There is a common SVN ancestor to both repositories, but each hg repo has a different version number for it. I would like to reparent Foo's changes from the common ancestor onto Bar's repo. Here's