branch

How to do a pull request in GitHub with only the latest commit in the master branch of my forked repository

帅比萌擦擦* 提交于 2019-11-27 09:41:19
问题 I forked a repository on github. I made some changes and did a pull request. Now I made some other changes and want to do a new pull request, but on the preview screen before doing the pull request it shows the old commits too (the ones that were already accepted). How do I select only the latest commit in the master branch of my forked repository so that I can do a pull request with only that commit? 回答1: This answer from a coworker fixed my problem: git checkout -b NEW_BRANCH_NAME LAST

Push a commit in two branches with Git

拟墨画扇 提交于 2019-11-27 09:32:33
问题 how do I push a commit in two branches? I can't use "git push", because then it pushes to three branches, and i just want the commit in two of them.. Ive tried a "git merge HEAD --commit id from branch A--" in branch B, but then it takes everything from branch A and merges with branch B. I just want the last commit and not everything else merged with branch B. Anyone know what to do? 回答1: Short answer You can apply already existing commit to another branch using cherry-pick command, and then

Git: copy all files in a directory from another branch

。_饼干妹妹 提交于 2019-11-27 09:16:28
问题 How do I copy all files in a directory from another branch? I can list all of the files in that directory by doing git ls-tree master:dirname I can then copy all of the files individually by doing git checkout master -- dirname/filename However, using wildcards has so far been a total fail. This does nothing: git checkout master -- dirname/*.png Though I guess I can use a bash script to do that, there has to be an easier way, right? 回答1: As you are not trying to move the files around in the

Correct Git workflow for shared feature branch?

守給你的承諾、 提交于 2019-11-27 09:14:08
问题 I am trying to figure out the right workflow for this situation: On the shared repo, we have these branches: -master -feature The feature branch is a shared branch, since many developers are working on a new feature together. They are actively pushing their changes to the feature branch. I'm trying to avoid 'conflict hell' for the day that feature finally gets merged back into master . Currently, I see some options: 1) Actively merge master into feature , and do it often. However, this is not

How do I delete a Git branch with TortoiseGit

∥☆過路亽.° 提交于 2019-11-27 09:13:04
问题 Is there an option to delete a branch with TortoiseGit? I found a solution for the commandline. Is there an implementation in TortoiseGit? 回答1: You should read this article: Remote branches with TortoiseGit According to this blog post: ...remove the local branch by first opening up the Checkout/Switch dialog to get at the Browse refs dialog. In the Browse refs dialog we can right click on the local branch and choose to delete it. To delete a remote branch we can do the same thing, but instead

git remote prune – didn't show as many pruned branches as I expected

耗尽温柔 提交于 2019-11-27 09:09:03
问题 From the man page: Deletes all stale tracking branches under <name>. These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in "remotes/<name>". So I removed a bunch of branches using git push origin :staleStuff and then ran git remote prune origin However, only one single local branch was pruned. Some of these branches were created by me, some by co-workers. Does this indicate that I wasn't tracking those branches

What is trunk, branch and tag in Subversion? [duplicate]

感情迁移 提交于 2019-11-27 09:08:34
问题 Possible Duplicate: What do “branch”, “tag” and “trunk” really mean? What is a trunk, branch and tag in Subversion and what are the best practices to use them? What tools can I use for Subversion in Visual Studio 2008? 回答1: The trunk is the main line of development in a SVN repository. A branch is a side-line of development created to make larger, experimental or disrupting work without annoying users of the trunk version. Also, branches can be used to create development lines for multiple

Best branching strategy when doing continuous integration?

五迷三道 提交于 2019-11-27 09:05:31
问题 What is the best branching strategy to use when you want to do continuous integration? Release Branching: develop on trunk, keep a branch for each release. Feature Branching: develop each feature in a separate branch, only merge once stable. Does it make sense to use both of these strategies together? As in, you branch for each release but you also branch for large features? Does one of these strategies mesh better with continuous integration? Would using continuous integration even make

How do I rename my git 'master' branch to 'release'?

陌路散爱 提交于 2019-11-27 09:02:23
问题 We would like to enforce a new policy for our projects that the master branch now be called the release branch to ensure it is more clear as to how the branch should be used. Naturally, we will have develop and release candidate branches as well. I understand I can rename the master branch locally by simply using the following: git branch -m master release However, that is only locally. Even if I push this up to the remote, the HEAD still points to the remote master branch. I want to get rid

Git: “Not currently on any branch.” Is there an easy way to get back on a branch, while keeping the changes?

懵懂的女人 提交于 2019-11-27 08:58:04
问题 So I've done some work in the repository and when I'm about to commit I realize that I'm not currently on any branch. This happens a lot when working with submodules and I am able to solve it, but the process is tedious and I've been thinking that there must be an easier way to do this. Is there an easy way to get back on a branch, while keeping the changes? 回答1: If you have not committed: git stash git checkout some-branch git stash pop If you have committed and have not changed anything