branch

git: Split history of some files into a separate branch

主宰稳场 提交于 2019-11-30 05:04:22
问题 Say I introduced <feature.c> a while ago and now notice it shouldn't have been part of my main branch but rather a branch feature . Is it possible to use e.g. git-filter-branch to automatically move all of <feature.c>'s history out of my main branch into the feature branch? 回答1: It sounds like you're doing something fairly insane! :) That said, I see a few options, none of which are particularly automated. If you've got a ton of commits with that file present, just admit the mistake, make a

Why are Mercurial backouts in one branch affecting other branches?

亡梦爱人 提交于 2019-11-30 04:55:37
This is a difficult situation to explain, so bear with me. I have a Mercurial repository with 2 main branches, default and dev . Work is usually done in a named branch off of dev (a feature branch). There may be many feature branches at any one time. Once work is completed in that branch, it is merged back into dev . When the time comes to prepare a release, another named branch is created off of dev (a release branch). Sometimes it is necessary to exclude entire features from a release. If that is the case, the merge changeset from where the feature branch was merged into dev is backed out of

Is there a way to keep two branches from merging in git

萝らか妹 提交于 2019-11-30 04:55:34
问题 I would like to be able to keep two separate branches in a git repo that cannot accidentally be merged even though the branches may contain similar content. Is there a trick for forcing a branch to remain separate in git? That is assuming I have branch A and branch B , something like git merge B //assuming A is checked out would fail. The concern here arose because in creating a repository of a website I'm developing I need the HEAD of the master branch to always be the current state of the

Freezing a Git branch

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 04:46:31
Let's say I have a develop branch. I create a feature branch from this to develop a feature. Once the feature is developed, it is merged back into develop. Pretty much like shown here: Is there a way I can freeze the feature branch so that no further commits can be made to it? The reason for not outright deleting the branch is so that viewing the history can still show the feature branch and that if there needs to be a tweak made to the feature then it is possible for someone to create a new feature branch from the last commit of the previous feature. gjcamann Christopher is right, tagging

使用Git Flow规范!

佐手、 提交于 2019-11-30 04:25:43
Git Flow常用的分支 Production 分支 也就是我们经常使用的Master分支,这个分支最近发布到生产环境的代码,最近发布的Release, 这个分支只能从其他分支合并,不能在这个分支直接修改 Develop 分支 这个分支是我们是我们的主开发分支,包含所有要发布到下一个Release的代码,这个主要合并与其他分支,比如Feature分支 Feature 分支 这个分支主要是用来开发一个新的功能,一旦开发完成,我们合并回Develop分支进入下一个Release Release分支 当你需要一个发布一个新Release的时候,我们基于Develop分支创建一个Release分支,完成Release后,我们合并到Master和Develop分支 Hotfix分支 当我们在Production发现新的Bug时候,我们需要创建一个Hotfix, 完成Hotfix后,我们合并回Master和Develop分支,所以Hotfix的改动会进入下一个Release Git Flow如何工作 初始分支 所有在Master分支上的Commit应该Tag Feature 分支 分支名 feature/* Feature分支做完后,必须合并回Develop分支, 合并完分支后一般会删点这个Feature分支,但是我们也可以保留 Release分支 分支名 release/*

Git - Automatically fast forward all tracking branches on pull

走远了吗. 提交于 2019-11-30 04:19:32
I've set up tracking branches with the --track option, and when I do a git pull on master , it fetches all branches to origin/branchname but doesn't merge with the local tracking branches. This is extra annoying, because if I later do a git push on master , it says that non-fast-forward updates were rejected on the tracking branches, since they weren't fast-forwarded on the initial git pull . My question is: How do I make it so that git pull with fetch all branches and automatically fast-forward all the tracking branches? Note: git pull used to fast-forward all my tracking branches with my

How do I use Git's interactive rebase with a local-only repository (no remote / origin)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 04:17:20
I use git as a local source control system mostly for history and diff tracking. I still want to use rebase to do fixup / squash on WIP commits that I will make periodically. When I try to do git rebase -i though, I get the following: There is no tracking information for the current branch. Please specify which branch you want to rebase against. See git-rebase(1) for details git rebase <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=<remote>/<branch> MyBranch It seems like git doesn't expect you to use interactive rebase without

How can I print the log for a branch other than the current one?

走远了吗. 提交于 2019-11-30 04:10:52
I'm on a branch with some changes. Changing branch is a pain as some files are locked by processes, so to change branch I'd have to stop all the processes which have locks, then stash the changes before checking out the other branch to see its log. Is it possible to view the log for a different branch, without having to check it out? TL; DR Use git log <branch> where <branch> is the name of the branch of interest. From the git-log man-page... A simplified version of the git-log synopsis given in that command's man page is git log [<revision range>] Further down, you can find the following

Display all first-level descendant branches using Git

匆匆过客 提交于 2019-11-30 03:42:23
问题 How can I get a list of branches that are first-level descendants of the current HEAD? I can get a list of the whole tree with: git log --graph --abbrev-commit --pretty=decorate --branches which gives * 2eff4a7... (refs/heads/issue-8351) Added a factory factory factory. * 2e387aa... Refactored all of the factory factories. | * b3fad52... (refs/heads/issue-8354) Moved the baz out of the constructor. |/ | * f4cf3fe... (refs/heads/experimental) quuz looking good | * 1d276b9... Risky fix to

Why would svn merge of a branch with no changes causes untouched files to modify svn:mergeinfo property

可紊 提交于 2019-11-30 02:47:32
问题 I have created a branch called "feature3" from my trunk. I make zero modifications to files on the "feature3" branch. There are also no modifications to files on trunk. Using TortoiseCVS (TortoiseSVN 1.6.6, Build 17493 - 32 Bit) against a SVN (version 1.6.3 (r38063)) repo, I initiate a "Merge" with the "Reintegrate a branch" option selected. The output of this command shows 80 files merged. The only thing changed on these files is the svn:mergeinfo property. But why only these 80 files? I