branch

What is the base branch when a new one is created?

核能气质少年 提交于 2019-12-20 10:12:11
问题 I need to confirm/correct my assumptions when creating branches. If I'm in master branch, after doing: git checkout -b some_branch it means I have started a new branch from master. On the other hand, if I checkout another branch, and create a branch there: git checkout some_branch git checkout -b other_branch This means I've created other_branch using all the current code committed from some_branch, right? And, regardless of the current branch, if this is done: git branch branch_2 branch_1

git: Merge Branches but Keep Commit History

淺唱寂寞╮ 提交于 2019-12-20 09:56:27
问题 In my git workflow we have one main repository and one branch, master. Everyone pulls from remote master and everyone pushes to remote master. I want to work in my own branch while I prepare a feature. So far my history is something like this: git pull --rebase git checkout -b new_feature <make some commits> git checkout master git pull --rebase Now I want to merge the branch and here's what I need: No merge commits in my local master branch. All commits made into my new_feature branch merged

git checkout branch from outside

僤鯓⒐⒋嵵緔 提交于 2019-12-20 08:56:54
问题 Problem: I need somehow to checkout an existing branch of a project that is already cloned locally on my file system without being in that particular folder of this project. Solution: I'm trying to do the following: git clone 'github-project-url' 'file-system-folder' git checkout 'existing-branch' 'file-system-folder' I do realize that second step is not quite right, but I also am trying to avoid to "cd 'file-system-folder'". 回答1: You can use --git-dir to specify the .git directory to use as

Mercurial workflow for ~15 developers - Should we use named branches?

被刻印的时光 ゝ 提交于 2019-12-20 08:49:15
问题 My team's just starting out with Mercurial and a central repository. We have Hudson building the tip of the "default" branch - which is basically our mainline. We had a check-in policy with our old VCS that code reviews, testing, etc. must be done before you check-in to the mainline. So, let's say you are working on feature X. You work on some stuff, basing it off of "default", and then you commit a partial feature as a checkpoint. Locally your "default" is now broken -- you haven't shared it

Untracked files between branches in Git

喜你入骨 提交于 2019-12-20 08:48:14
问题 I've been searching around here for to look for an answer and it seems I may just be making incorrect assumptions on how git branches are supposed to work. I have my master branch and I've created a feature branch called profiles where I'm doing some specific work to profiles. While working on profiles I've changed 5 or 6 files and added another 5 or 6 new files. I needed to switch back to the master branch to fix a quick bug and noticed all the new files and modified files where in there as

Getting Beyond Compare to Diff 2 Branches Simultaneously

放肆的年华 提交于 2019-12-20 08:44:59
问题 >>git difftool branch1 branch2 opens my difftool (Beyond Compare:BC) with every file that has a diff between the branches. I have to close BC after each file just for it to reopen with the next file. BC can diff whole directories and multiple files. Is there a way to get git difftool to open all files simultaneously, or diff the whole tree simultaneously? 回答1: Starting with git v1.7.11, you can use git difftool --dir-diff to perform a directory diff. The answer that follows applies to git

Git: how to maintain permanent parallel branches

给你一囗甜甜゛ 提交于 2019-12-20 08:34:53
问题 We have project (PHP application), but instalation for each client vary, sometimes very little, sometimes more. Still, big part of source code is common. We manage specific installations as parallel branches to master branch and we need to transfer changes from master to other branches. Same situation was solved in Git: how maintain (mostly) parallel branches with only a few difference? The most voted solution was to transfer changes between braches this way: git pull git checkout local git

Git: List git branches, sort by (and show) date [duplicate]

↘锁芯ラ 提交于 2019-12-20 08:26:13
问题 This question already has answers here : How can I get a list of Git branches, ordered by most recent commit? (28 answers) Closed 2 years ago . How can I list git branches showing and sorting by their last commits' dates? I've found this: for k in `git branch | sed s/^..//`; do echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" "$k"`\\t"$k"; done | sort -r I'd expect plain git to have this feature. Does it? I also found git show-branch --date-order but the output is something

Git: List git branches, sort by (and show) date [duplicate]

こ雲淡風輕ζ 提交于 2019-12-20 08:26:06
问题 This question already has answers here : How can I get a list of Git branches, ordered by most recent commit? (28 answers) Closed 2 years ago . How can I list git branches showing and sorting by their last commits' dates? I've found this: for k in `git branch | sed s/^..//`; do echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" "$k"`\\t"$k"; done | sort -r I'd expect plain git to have this feature. Does it? I also found git show-branch --date-order but the output is something

Commit changes to a different branch than the currently checked out branch with subversion

被刻印的时光 ゝ 提交于 2019-12-20 08:21:51
问题 I've been working on code checked out from the development line and discovered that the changes made might be breaking changes and need to be moved to an experimental branch before committing to the main dev tree. However, I don't have the experimental branch checked out and I don't want to lose the changes that have already been made. Is there a way to commit the changes in the working folder to a different branch than originally checked out? 回答1: You should create a branch from a known