git-branch

Delete branches in Bitbucket

耗尽温柔 提交于 2019-11-29 18:54:23
I've created lots of branches in one of our repositories. Those branches are for testing before it will be pulled to the master. Now I see lots of them on the list and they we will never use it again. How to delete those branches directly to Bitbucket? Marcus If the branches are only local, you can use -d if the branch has been merged, like git branch -d branch-name If the branch contains code you never plan on merging, use -D instead. If the branch is in the upstream repo (on Bitbucket) you can remove the remote reference by git push origin :branch-name Also, if you're on the Bitbucket

Why does Git not store the branch name as part of the commit?

久未见 提交于 2019-11-29 17:55:30
问题 Please note : I'm not trying to restart the argument whether Mercurial or Git is better, I just have a technical question that I, as a Mercurial user, don't understand. I'm also not sure whether SO is the right place to ask such a question, but it is programming related. There have been many discussions about how the two version control systems Git and Mercurial differ from each other from a user's point of view (e.g. What is the Difference Between Mercurial and Git? and http://felipec

Can I enforce a merge-only branch in git?

不问归期 提交于 2019-11-29 16:37:21
问题 I'm using git, and I'm setting up the following branches to support my workflow: release, which only contains released software, testing, which contains software released to the testing group, develop, which is where development happens, some_topic_branch, where features, etc. get added. Topic branches branch from and get merged into develop. When we're ready for a testing release, testing merges in develop. When a testing release is approved for production, release merges in testing. This is

Prevent merging a file from master with Git

故事扮演 提交于 2019-11-29 15:15:30
问题 In another question it is recommended to use .gitattributes in order to keep the file tracked but not merged in different branch, but my use case below seems not working.. mkdir git cd git git init echo "B" > b.txt git add b.txt git commit -m 'Initial commit' echo "b.txt merge=keepMine" > .gitattributes git add .gitattributes git config merge.keepMine.name "always keep mine during merge" git config merge.keepMine.driver "keepMine.sh %O %A %B" git commit -m 'Ignore b.txt' git checkout -b test

Which branch do commits from a deleted branch belong to?

柔情痞子 提交于 2019-11-29 14:57:32
If I merge branch A into branch B and then delete A, which branch do commits from branch A (now deleted) belong to? Git branches are mere pointers to commits. Asking Which branch does this commit belong to? doesn't really make sense (at least, not in the general case) because commits may very well be reachable from multiple branches (or even from none at all!). Consider the following example: Commit F is currently only reachable from the bugfix branch; at this point, it makes sense to say that commit F "belongs" to the bugfix branch. However, if you then merge bugfix into master , by running

Rollback to uncommited changes after hard reset a Git Repository

半腔热情 提交于 2019-11-29 11:46:16
Mistakenly, i hard reset my git repository. By doing this all the changes that i have made has been gone. Now, i want to rollback Git to all the uncommitted changes. Please help me with this. VonC "uncommitted changes" means local repo (even though you have a remote repo on amazon ec2) That means you must have added ( git add ) files to a local clone, then do a git reset --hard . If that is the case, you can still find those added files with a git fsck , as described in Recover files that were added to the index but then removed by a git reset : first, do a full backup of your current repo

How to get information where branch starts?

六月ゝ 毕业季﹏ 提交于 2019-11-29 09:40:19
问题 As far as I know, commit object contains information only about parents, so if I have situation something like this: * branch-1 | o | o master | o which is some kind of equivalent of * branch-1 | o / o master | o but what if my master will go forward? o master | o * branch-1 | | o o |/ o | o being on branch-1, git log --graph --decorate will show me only: * branch-1 | o | o | o if I know from which branch I was started, I can call git merge-base master branch-1 , but what if I don't know from

Git Tracking Upstream

假如想象 提交于 2019-11-29 09:39:20
问题 I am working on a project and I have a central git repo. This project is a skeleton to be a baseline for a number of forks. Is it possible to configure my local working repository for a fork to track the central for the project as origin and track the skeleton's master as a separate branch named upstream tracking the master of the skeleton to cherry pick changes to the skeleton? I guess I want my workflow to be something like: Create Skeleton >> Fork Skeleton >> Skeleton Pulls Changes from

Issue with git pull master is out of sync with origin master

北城余情 提交于 2019-11-29 04:15:05
问题 These are the sequence of steps I have performed: committed my changes in branch to local master (commit id dc9afg2k ) git fetch origin master && git merge origin master git checkout master git pull (this pulled all recent changes) git fetch origin master && git merge origin master git reset --hard origin/master git checkout branch git blog git reset --hard dc9afg2k (commit successful) git checkout master git log (this was gone back to 2 days ago). git pull ( master is not updating with

Freezing a Git branch

别等时光非礼了梦想. 提交于 2019-11-29 02:04:27
问题 Let's say I have a develop branch. I create a feature branch from this to develop a feature. Once the feature is developed, it is merged back into develop. Pretty much like shown here: Is there a way I can freeze the feature branch so that no further commits can be made to it? The reason for not outright deleting the branch is so that viewing the history can still show the feature branch and that if there needs to be a tweak made to the feature then it is possible for someone to create a new