branch

Git merge from a specific folder only

随声附和 提交于 2019-12-18 13:48:51
问题 I've created a rails website for client X. I now have a client, Y, who wants a website that does the exact same thing as client X, but with a different skin. I made a git branch from clientXcode and called it clientYcode. I then did all the changes to the views to make it look different, and lala, the same website with a different skin. Now here's what I don't understand about git: I've made many changes to clientXcode in the views, models, and controllers; and now I want to merge those

How to undo a commit and commit the changes into the other branch in Git?

别等时光非礼了梦想. 提交于 2019-12-18 13:35:50
问题 The common mistake I make in git is not check on which branch I am commit changes to a wrong branch (on branch B, thinking I'm on A, commiting a change for feature A) How do I get back, and commit the edits to the proper branch? 回答1: rebase --onto can help here, especially if you have a range of commits to move back. Do not forget a git stash to save any current uncommitted changes which are relevant to " wrongBranch " (the one where commits were appropriately applied), in order to pop them

Sorting out a Git mess

北慕城南 提交于 2019-12-18 13:16:21
问题 I've just inherited a project which was maintained using Git. At one point, the code was deployed onto 3 separate systems and each system maintained their own decentralised Git respository. Each of the 3 systems extended the original base system in 3 different directions. None of the 3 systems have been synchronised against each other. Some changes are on master branch, others are on new branches. How can I bring the 3 different sources together so that I can: find a common base to work with;

Merging changes from master into all branches using Git?

房东的猫 提交于 2019-12-18 13:06:04
问题 I use git to maintain multiple working copies of my code. The idea is that I can check out any branch, build and run it to see how the branch's feature x fits in with the current state of the code. Git's master branch is the Trunk and the other git branches are features or things I would like to try out. Therefore, my typical usage is updating the master with the latest fixes and then merging master into the individual branches so each of them stays up to date. This system works well for me,

How to compare sets of changesets between 2 Mercurial branches?

天大地大妈咪最大 提交于 2019-12-18 12:17:18
问题 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. 回答1: 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

Why are Mercurial backouts in one branch affecting other branches?

Deadly 提交于 2019-12-18 11:48: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

SVN-分支的合并和同步

谁都会走 提交于 2019-12-18 10:54:41
先说说什么是branch。按照Subversion的说法,一个branch是某个development line(通常是主线也即trunk)的一个拷贝,见下图: branch存在的意义在于,在不干扰trunk的情况下,和trunk并行开发,待开发结束后合并回trunk中,在branch和trunk各自开发的过程中,他们都可以不断地提交自己的修改,从而使得每次修改在repository中都有记录。 设想以下场景,如果你的项目需要开发一个新功能,而该功能可能会修改项目中的绝大多数文件,而与此同时,你的另一位同事正在进行bug fix,如果你的新功能不在branch中开发而直接在trunk中开发,那么你极有可能影响另一位同事的bug fix,他/她在bug修复中可能会遇到各种各样的问题,因为你的频繁提交代码引入了过多的不稳定因素。你可能会说,那我在开发的过程中不提交不就行了,等到我全部开发结束我再提交,是,你可以这么做,那还要版本控制干什么呢?也许等到你最后提交代码的时候(也许一周,也许两周?),你会发现有一大堆conflict等着你resolve。。。 那么,正确的做法是什么?使用branch,从trunk创建branch,然后在你的branch上开发,开发完成后再合并到trunk中。 关于branch先讲到这里,下面说说什么叫做合并。很好理解,当branch开发完成后(包括必要的测试

How to rename an SVN branch and update references in an existing sandbox?

只谈情不闲聊 提交于 2019-12-18 10:48:07
问题 I needed to rename a SVN branch, so I did: $ svn move https://server/repos/myrepo/branches/oldbranch \ https://server/repos/myrepo/branches/newbranch So far, so good -- the branch has been renamed. The trouble is, we have existing sandboxes checked out from this branch and when I try to update I get this error: $ svn update svn: Target path '/branches/oldbranch' does not exist A fairly self-explanatory error. After a quick search I thought I had found the solution: Relocating SVN working copy

In TFS, should I label or create a branch for a production release?

↘锁芯ラ 提交于 2019-12-18 10:25:37
问题 When making a deployment to production, should I mark my code with a label or create a branch for the code that's in production? 回答1: In TFS, I would have a Release branch with a label identifying the specific version being released to production. Which would imply you have other branches may I suggest the following Three major branches: Main, Develop, & Release. One Hotfix branch for your current fire. 0 to N Major-Feature branches to contain the disruption of development. Details Main

What is a “stale” git branch?

╄→гoц情女王★ 提交于 2019-12-18 10:12:26
问题 A "Stale" git branch is a term I've heard a lot. I know it has something to do with branches which are regarded as less useful or useless, but cannot find an exact definition. What is a "stale" git branch? 回答1: The oldest reference to "stale" is found in commit e194cd1 (Jan. 2007, Git 1.5.0), which detected " stale tracking branches in remote ": when tracking a branch which was removed by the remote system. Hence git remote prune. That is the main definition for stale branch: a remote