branch

如何重命名本地Git分支?

眉间皱痕 提交于 2019-11-30 07:32:29
我不想重命名远程分支,如 重命名本地和远程Git存储库的master分支中 所述。 如何重命名尚未推送到远程分支的本地分支? 如果您还需要重命名 远程 分支: 如何重命名Git本地和远程分支名称 #1楼 git branch -m old_branch_name new_branch_name 上面的命令将更改您的分支名称,但是使用重命名的分支必须非常小心,因为它仍将引用与其关联的旧的上游分支(如果有)。 如果要在将本地分支重命名为new_branch_name(示例名称)后将一些更改推送到master中,请执行以下操作: git push origin new_branch_name:master (现在更改将转到master分支,但您的本地分支名称为new_branch_name) 有关更多详细信息,请参见“ 如何在Git中重命名本地分支名称 ”。 #2楼 重命名当前分支: git branch -m <newname> #3楼 到目前为止,答案是正确的,但是这里有一些其他信息: 可以安全地用'-m'重命名分支(移动),但是使用'-M'时要小心,因为即使已经存在相同名称的分支,它也会强制重命名。 以下是“ git-branch”手册页的摘录: 使用-m或-M选项, <oldbranch> 将重命名为 <newbranch> 。 如果 <oldbranch> 具有相应的引用日志

How to get information where branch starts?

折月煮酒 提交于 2019-11-30 07:28:43
As far as I know, commit object contains information only about parents, so if I have situation something like this: * branch-1 | o | o master | o which is some kind of equivalent of * branch-1 | o / o master | o but what if my master will go forward? o master | o * branch-1 | | o o |/ o | o being on branch-1, git log --graph --decorate will show me only: * branch-1 | o | o | o if I know from which branch I was started, I can call git merge-base master branch-1 , but what if I don't know from which branch I was started? PS. I am still learning English, however sometimes I am making stupid

How to compare sets of changesets between 2 Mercurial branches?

有些话、适合烂在心里 提交于 2019-11-30 06:43:51
I've got a (remote) Hg repository with a couple branches. I want to verify that branch A has every changeset that branch B has (it may have more, and that's OK). Is there an easy way to do this with just hg ? I can write a little shell script to do it, but it seems like the sort of thing that might come up a lot, so maybe there's an easy built-in way. This will show any ancestors of changeset b which are not an ancestor of changeset a : hg log -r "ancestors(b) and not ancestors(a)" This should show you which changes still need to be merged from B to A if you give the head of branch B for b,

When is the reintegrate option really necessary?

萝らか妹 提交于 2019-11-30 06:28:44
If you always synchronise a feature branch before you merge it back. Why do you really have to use the --reintegrate option? The Subversion book says: When merging your branch back to the trunk, however, the underlying mathematics is quite different. Your feature branch is now a mishmosh of both duplicated trunk changes and private branch changes, so there's no simple contiguous range of revisions to copy over. By specifying the --reintegrate option, you're asking Subversion to carefully replicate only those changes unique to your branch. (And in fact, it does this by comparing the latest

What branching strategy should I use during the development/maintenance of a web application?

ε祈祈猫儿з 提交于 2019-11-30 06:27:51
问题 I am trying to decide on the best branching strategy for a web application project. Here is what I have come up with until now and I would greatly appreciate any comments and experiences. The way I see it there are two main branching strategies: "branch by release" and "branch by feature". "Branch by release" : Development takes place on the trunk. When the time for a release is near, a branch is made for that release. This branch is then stabilized/tested and finally a release is made. After

Missing ranges error message when reintegrating a branch into trunk in Subversion 1.5

风格不统一 提交于 2019-11-30 06:27:45
I'm trying to reintegrate a development branch into the trunk in my Subversion 1.5 repository. I merged all the changes from the trunk to the development branch prior to this operation. Now when I try to reintegrate the changes from the branch I get the following error message: Command: Reintegrate merge https://dev/svn/branches/devel into C:\trunk Error: Reintegrate can only be used if revisions 280 through 325 were previously Error: merged from https://dev/svn/trunk to the reintegrate Error: source, but this is not the case: Error: branches/devel/images/test Error: Missing ranges: /trunk

How to move some changeset to a new branch in mercurial

放肆的年华 提交于 2019-11-30 06:19:19
问题 I want to move a changeset from one branch to another. Basically, I currently have: A -> B -> C -> D # default branch And I want: A # default branch \-> B -> C -> D # some_new_branch Where some_new_branch does not exist yet. I am used to git, so I guess there is a simple "mercurial" way I am missing. 回答1: One way is to export a patch for B,C,D; update to A; branch; apply patch: hg export -o patch B C D hg update A hg branch branchname hg import patch To remove B,C,D from the default branch,

best practices in mercurial: branch vs. clone, and partial merges?

岁酱吖の 提交于 2019-11-30 06:09:38
问题 ...so I've gotten used to the simple stuff with Mercurial ( add , commit , diff ) and found out about the .hgignore file (yay!) and have gotten the hang of creating and switching between branches ( branch , update -C ). I have two major questions though: If I'm in branch "Branch1" and I want to pull in some but not all of the changes from branch "Branch2", how would I do that? Particularly if all the changes are in one subdirectory. (I guess I could just clone the whole repository, then use a

How to 'git pull' into a branch that is not the current one?

自闭症网瘾萝莉.ら 提交于 2019-11-30 05:50:12
问题 When you run git pull on the master branch, it typically pulls from origin/master . I am in a different branch called newbranch , but I need to run a command that does a git pull from origin/master into master but I cannot run git checkout to change the selected branch until after the pull is complete. Is there a way to do this? To give some background, the repository stores a website. I have made some changes in newbranch and deployed them by switching the website to newbranch . Now those

How do I properly branch post-commit and revert the trunk in svn?

不打扰是莪最后的温柔 提交于 2019-11-30 05:13:15
I have some commits that I've decided, after the fact, are going to be more branch work then trunk work. How do I create the branch and revert the trunk while still ensuring merging isn't painful later? Is it as simple as copying the current trunk to a branch and reverting the trunk? Or will this create headaches later? I think Philips method would be something like the following, assuming the last "good" revision was at 100 and you are now at 130, to create the new branch: svn copy -r100 svn://repos/trunk svn://repos/branches/newbranch svn merge -r 100:130 svn://repos/trunk svn://repos