git-branch

Is there a way to get a visual diff on two branches in SourceTree?

为君一笑 提交于 2019-12-03 02:05:06
问题 Does Sourcetree offer a way to visualize differences between git branches? I'm looking for: names of files that have changed diffs between these files 回答1: Use ⌘ (OSX) or CTRL (Windows and Linux) and choose any two commits you like in log view. It does not matter what branch the commits belong to. As a result you will see something like... Displaying all changes between f03a18bf0370c62bb5fb5c6350589ad8def13aea and 4a4b176b852e7c8e83fffe94ea263042c59f0548 ...down below. 回答2: Another way to do

How to delete all remote git branches which have already been integrated?

陌路散爱 提交于 2019-12-03 01:58:38
问题 At work we are using topic branches which are integrated into a few (3) master branches at some point. Now I'd like to delete all topic branches from my remote repository which have been fully integrated into a master branch. If that's not possible, retrieving a list of local branches which have been integrated would be fine, too. 回答1: Another answer edited in by someone who thought it's the best (and it looks good) : git branch -r --merged origin/master | grep -v master | grep "origin/" |

Fork from a branch in github

纵饮孤独 提交于 2019-12-03 01:41:16
问题 Is there a way to fork from a specific branch on GitHub? … For example, moodle has many branches (1.9, 2.0 … and so on). Can a clone be performed of just branch 1.9 and not the master branch always? Is it possible to clone a specific branch onto my PC? 回答1: I don’t know a native way yet, but you can do it following this recipe: Fork the repository in question (called ‘upstream’) on the GitHub website to your workspace there. Run the GitHub desktop application and clone the repository onto

How to undo git flow feature finish?

巧了我就是萌 提交于 2019-12-03 01:39:46
问题 I am learning git-flow and I just did git flow feature finish <feature-name> , which merged my feature branch to develop and removed it. Instead of this, I want to push the feature branch to github, so I can merge it after a peer review. So the question is, how do I 'undo' this command. Or in other words , how can I move my last two commits from develop to my feature branch? 回答1: These steps should do the trick: Get the sha's needed: git log <sha1> is the commit right before the merge <sha2>

How to create the branch from specific commit in different branch

只愿长相守 提交于 2019-12-03 01:00:28
问题 I have made several commits in the master branch and then merged them to dev branch. I want to create a branch from a specific commit in dev branch, which was first committed in master branch. I used the commands: git checkout dev git branch <branch name> <commit id> However, this creates the branch from master branch, not the dev branch I expected. The commit id is same in master branch and dev branch. So, how can I distinguish same commit id in different branch? PS: I made an example in

Git tag release version?

喜你入骨 提交于 2019-12-03 00:38:40
A pre-release version MAY be denoted by appending a dash and a series of dot separated identifiers immediately following the patch version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92. semver.org For the purpose of disambiguation, what would be a "proper" way to tag a release commit (commit from the master branch)? Some ideas v1.7.2-release v1.7.2-master v1.7.2-prod v1.7.2-official v1.7.2-stable github.com/antirez/redis/tags You can choose a policy similar to Git itself (see its tags in the GitHub repo ): v1.7.2-rc0 v1.7.2-rc1 v1.7.2-rc2 v1.7.2-rc3 v1.7.2 The idea (as

How to read git log graph

天大地大妈咪最大 提交于 2019-12-03 00:37:35
问题 In the git community book, it says Another interesting thing you can do is visualize the commit graph with the '--graph' option, like so: $ git log --pretty=format:'%h : %s' --graph * 2d3acf9 : ignore errors from SIGCHLD on trap * 5e3ee11 : Merge branch 'master' of git://github.com/dustin/grit |\ | * 420eac9 : Added a method for getting the current branch. * | 30e367c : timeout code and tests * | 5a09431 : add timeout protection to grit * | e1193f8 : support for heads with slashes in them |/

Git pulling a branch from another repository?

旧巷老猫 提交于 2019-12-03 00:14:17
问题 I have a local git repository which is a clone of a repository on github. Someone has forked the repository and made changes in a new branch on a new repository. I want to move this new branch into my repository (locally to work on it first before merging with the master). I tried creating a new branch and then pulling from the forked repository but it complains because the new branch is a copy of the master branch as well as the local file changes, so it says error: Your local changes to the

When to delete branches in Git?

自闭症网瘾萝莉.ら 提交于 2019-12-03 00:03:01
问题 Suppose we have an application that's stable. Tomorrow, someone reports a big ol' bug that we decide to hotfix right away. So we create a branch for that hotfix off of "master", we name it "2011_Hotfix", and we push it up so that all of the developers can collaborate on fixing it. We fix the bug, and merge "2011_Hotfix" into "master" as well as into the current development branch. And push "master." What do we do with "2011_Hotfix" now? Should it just sit out there as a branch forever until

How do I push a local Git branch to master branch in the remote?

这一生的挚爱 提交于 2019-12-02 23:59:33
问题 I have a branch called develop in my local repo, and I want to make sure that when I push it to origin it's merged with the origin/master. Currently, when I push it's added to a remote develop branch. How can I do this? 回答1: $ git push origin develop:master or, more generally $ git push <remote> <local branch name>:<remote branch to push into> 回答2: As people mentioned in the comments you probably don't want to do that... The answer from mipadi is absolutely correct if you know what you're