git-branch

How can you tell who merged which branch into git?

风格不统一 提交于 2020-01-07 06:54:22
问题 We are using git for a project, making use of git flow (http://nvie.com/posts/a-successful-git-branching-model/) to manage hotfixes, features, etc. However, somehow the changes in develop (which is weeks ahead of master ) have been merged into master , and a recent git push has published the unstable develop branch! How can I find out who merged develop into master and when this was done? How can I undo this, given that there will likely have been commits made after this merge, and also given

How to take local working directory to any git revision irrespective of its branch after remote changes?

旧城冷巷雨未停 提交于 2020-01-07 02:42:44
问题 Background I am working on a phing build script, which takes input as the target revision to which the production codebase needs to be taken. I am preparing the same in a separate scratchpad directory and then overwriting the production codebase. Current logic During every build, I am simply emptying the scratchpad and taking a fresh clone of the entire git repository in it. Taking to the desired revision - git reset --hard ${target.git_version} I am sure something more efficient can be done.

How to get a git-branch -avv like list of tags?

好久不见. 提交于 2020-01-07 00:56:07
问题 git branch -avv shows all branches (including remote ones), decorating them with the tracking branch, short-SHA and commit title. Is there a similar command to display all tags together with the commit they point to, optionally including whether it is pushed upstream, and additionally with the message if the tag was annotated? The best I could get so far is: git tag --format '%(color:green)%(refname:short)%09%(color:white)%(objectname:short) %(contents:subject)' But this has several problems:

Join old and new repo, created by copying files (not cloning), preserving commit history

五迷三道 提交于 2020-01-06 20:16:51
问题 To simplify things I have the following structure in git old_repo for "subpath": subpath/old_commit_1 subpath/old_commit_2 subpath/old_commit_latest I decided to move to a new_repo and just copied the latest version of "subpath" (from old_commit_latest) into it without any commit history. So the new_repo now has "subpath" and a bunch of new commits I made to it: subpath/new_commit_subpath_added # added subpath here subpath/new_commit_1 subpath/new_commit_2 subpath/new_commit_latest Now I need

git clone specific list of branches

≡放荡痞女 提交于 2020-01-06 11:47:10
问题 I want to clone a list of branches from remote repo. What is the best way to do that without fetching everything? I saw solutions for cloning one specific branch but I need multiple branches. Thank you. Edit: I ended up using following command to create a bundle and then using it for my purposes: git bundle create ../BUNDLE.bundle branch1 branch2 refs/notes And then using this bundle for my purposes. 回答1: You start with one branch: git clone --branch first URL localrepo and then fetch all the

Git merge to all branches

戏子无情 提交于 2020-01-06 04:01:06
问题 I have branches v1.0 v1.1 v1.2 v1.3 v1.4 [master] now i checkout the v1.0 and add some directory with files (db tables, stored procedures, etc) how to merge the newly added directory with files in all branches so my head branch will be updated with that directory 回答1: I guess you need just that particular directory and no other changes which were introduced in different branches, if that is the case then, one way which comes to my mind right now is git cherry-pick . Just check git log and

confused about git branches and master interaction

徘徊边缘 提交于 2020-01-05 07:22:10
问题 I am working locally. I checked out a branch "b1" and did some work on it. I want to keep the branch "b1" the way it is but go back to the master and for it to be like it was before I checked out "b1". But when I check out master with "git checkout master" all the changes I made in the branch are already in the master without any commits or merges. What am I doing wrong? 回答1: Did you commit your changes to b1 before checking out master again? If you do not commit or stash your changes before

How to remove unnamed branch in git shown in Github network view

*爱你&永不变心* 提交于 2020-01-02 08:05:05
问题 In the Github's network view of my git repository, there is a "phantom" branch that has no name. Please see the picture below. For the sake of simplicity I would like to remove the black branch (leaving only the blue branch). How can this be done? Some of the labels with the hash: 回答1: Assume the black branch starts at Commit A, and ends at Commit Z. Both A and Z are the blue dots. In the cmd, A and Z are the commit sha1. git rebase --onto Z^2 A master This makes a linear history. But if

How to remove unnamed branch in git shown in Github network view

微笑、不失礼 提交于 2020-01-02 08:04:45
问题 In the Github's network view of my git repository, there is a "phantom" branch that has no name. Please see the picture below. For the sake of simplicity I would like to remove the black branch (leaving only the blue branch). How can this be done? Some of the labels with the hash: 回答1: Assume the black branch starts at Commit A, and ends at Commit Z. Both A and Z are the blue dots. In the cmd, A and Z are the commit sha1. git rebase --onto Z^2 A master This makes a linear history. But if

How to list branches that contain a given commit on a specific repository?

人盡茶涼 提交于 2020-01-02 05:21:33
问题 So I've read Git: How to find out on which branch tag is? and many other posts and I already know how to use: git branch --contains tag However, I still need to know how to list branches that contain a given commit (or tag) in specific repository . Background I've extracted a list of tags from a remote repository archive using: git ls-remote --tags archive Now, for each of the tags extracted, I wish to get the list of containing branches. Using command: git branch --contains tag doesn't help