branching-and-merging

Move branch to another branch

我只是一个虾纸丫 提交于 2019-12-03 02:31:23
I have started doing some work on a branch which I have in term realised was the wrong branch. Is there a way to move a branch to a different branch. For example: A -- B -- C -- D -- HEAD \-- E -- F -- G -- H -- I -- J \-- K -- L And I want this: A -- B -- C -- D -- HEAD \ \-- K -- L \ \-- E -- F -- G -- H -- I -- J Let's say you've named your branches like so: A -- B -- C -- D (master) \-- E -- G -- H -- I -- J (current-parent) \-- K -- L (my-branch) What you want to do is rebase my-branch onto the B commit like so: git rebase current-parent my-branch --onto B You could use git rebase --onto

What I can do to resolve “1 commit behind master”?

断了今生、忘了曾经 提交于 2019-12-03 02:02:16
问题 After pushing I've been seeing this message at remote repository: 1 commit behind master. This merge has conflicts that must be resolved before it can be committed. To manually merge these changes into TA20footerLast run the following commands: > git checkout 7c891f50c557 # Note : This will create a detached head! > git merge remotes/origin/master 回答1: I know this is a late answer but it could help others. Before you begin, if you are uncomfortable with a command line, you can do all the

How to undo git flow feature finish?

巧了我就是萌 提交于 2019-12-03 01:39:46
问题 I am learning git-flow and I just did git flow feature finish <feature-name> , which merged my feature branch to develop and removed it. Instead of this, I want to push the feature branch to github, so I can merge it after a peer review. So the question is, how do I 'undo' this command. Or in other words , how can I move my last two commits from develop to my feature branch? 回答1: These steps should do the trick: Get the sha's needed: git log <sha1> is the commit right before the merge <sha2>

How to ignore files in Git merge?

江枫思渺然 提交于 2019-12-03 00:23:34
I'm working on a (Django) website with two branches: master and dev . master is the production version and no work should be done here directly. All the changes should come from merging dev branch, once it is considered to be stable. dev , as you may guess, is the development branch and all the changes are made here (and subbranches). In the server I have two websites working, the production one (uses master branch) and another private for development, with dev subdomain that uses dev branch. The problem is that all the configuration files, static files (images, etc.) are inside the control

SVN - automate merge of trunk into branch

蓝咒 提交于 2019-12-02 23:52:10
I have a branch in SVN that I want to keep up to date with changes from the trunk. What I would like to do is have a script or something that runs nightly that does this merge and then commits the new version of the branch if there are no merge conflicts but if there are merge conflicts somehow indicate so. I found this post that is somewhat helpful although it doesn't do everything. I have been unable to find a way to determine whether there are merge conflicts and this is mostly what I'm looking for. Adding building the code and then committing on success will be easy enough in the script

Perforce, How to integrate a change to another branch?

ⅰ亾dé卋堺 提交于 2019-12-02 22:57:48
I have trunk and a release branch. If I fixed a bug in release branch, I definitely should integrate the fix back to trunk. However, I didn't find a command dedicated to integrate such a single change list; did I miss something? To integrate changelist 100, for example, you'd use: p4 merge //releasebranch/...@=100 //trunk/... p4 resolve p4 submit (If you have an older Perforce server you'll have to use 'integ' instead of 'merge'.) Note that '@=100' means the same thing as '@100,100' in this context. 来源: https://stackoverflow.com/questions/12106321/perforce-how-to-integrate-a-change-to-another

git — locking master branch for some users?

耗尽温柔 提交于 2019-12-02 20:39:27
I would like to force other team-members to not work on the master-branch but on a development branch. we have a central git-repository where we push our work into. i would like to know if it's possible to block users from pushing changes to the master-branch but only allow certain users to do so. I would like to have the following "workflow" development is always only done with a development-branch the release-manager is responsible for the master branch and only he is allowed to merge stuff from a development branch into the master and push it to the master-branch on the central repository

Find the latest merge point of two branches

安稳与你 提交于 2019-12-02 18:08:09
Having two branches, how can I find the latest revision(s) where the two branches were merged? Is there a standard Mercurial command to do that? This is the same as question How to find the common ancestor of two branches in SVN? , but for Mercurial instead of subversion. I didn't understand why Lazy Badger's answer was the right one, so I had to make a little drawing, and now I get it: When two branches are merged, they are not really "merged", but the changes from one branch are integrated into a second branch. This means that the merge commit only belongs to the originating branch, and not

Mercurial - close default branch and replace with a named branch as new default

孤街浪徒 提交于 2019-12-02 17:39:10
In a mercurial repo, the "default" branch has fallen very out of date to the point where it no longer makes sense to merge in the changes from "develop", a named branch which has the latest deployed version of the application. Instead of merging develop into default, how can I close the current default branch and then create a new default branch using the head from develop? I've seen a few other questions and answers which are similar, perhaps the same, but I am still having trouble understanding how this should work. Thanks! If default has diverged somewhat from develop and you want default

Merging Mercurial branches from separate repositories

拥有回忆 提交于 2019-12-02 17:30:19
I'm trying to figure out how to merge branches from a separate repo into the current. I have the following: PJT1 - contains branches default and foodog PJT2 - contains branch default from PJT2, I do the following: $ hg fetch -y ../PJT1 -r foodog -m "this is a test" Now, if I look in PJT2, I see the correct files and changes. However, I if I do hg branches , I get the following: [someone@myhome pjt2]$ hg branches foodog 1:c1e14fde816b default 0:7b1adb938f71 (inactive) and hg branch reveals the following: [someone@myhome pjt2]$ hg branch foodog How do I get the contents from PJT1's foodog branch