Tag: branch

Keeping Git branches up to date while waiting for them to be merged into upstream

I forked a GitHub project, implemented a few features and fixed a few bugs in separate branches, sending pull requests for all of them. While waiting for them to be accepted into upstream, I want to use all these features and fixes. For that, I create a branch ‘my-master’, from ‘upstream/master’ and merge all changes […]

Code review of a branch in GitHub

I need to do a code review of a whole branch in GitHub. I went to the branches page and hit compare. There’s a tab there, files changed, that shows exactly what I need, the diff between the two branches, master and the selected one. The problem is that it doesn’t allow you to comment […]

Git: Unable to understand why branch (topic) commits/merges are happening on the master branch

Note: I am not sure whether this has been already asked, as I can’t find any question fitting to my context(or I am unable to understand the existing questions’ contexts’) I am loving Git these days. Especially, the topic branches. I am working on a small code sharing application. And I have got (local)branches like […]

GIT: How to protect the branch from being removed by other developers?

After the first release of our product, we will be switching to a different branches for the main development and feature development. Is there a way to create a branch in such a way, so that we can protect it from being removed (accidentally or on purpose) unless you’re a specific user (based on role […]

Anonymous branch after doing git reset

Background: Trevor was working on a test project solely for the purpose of trying out git. This is a local one-person repository that has not been shared so Trevor did a reset hard in order to obliterate some unwanted commits: :git reset –hard 6aa32cfecf4 HEAD is now at 6aa32cf auto commit Sun Feb 28 16:00:10 […]

Scare of My Life With GIT: I've got no branch!

I had checked out an old hash (commit) and was working on it, checking in merrily and ignoring warnings that I wasn’t working in a branch. Then I switched to a branch and realized that I had no way to get back to my orphaned checkins (luckily I had the terminal window open still, so […]

Move Old Commit to New Branch

I’ve accidentally started working on a new feature in the middle of another. My repository simply looks like this: A – B – C – D – E master But I’m hoping to make it look like this: A – B – D – E master \ C new-feature It seems like a simple question, […]

Git: How to keep local feature branch updated with changes made in dev?

I’ve been following this guide for working with distributed git projects: http://nvie.com/posts/a-successful-git-branching-model/. It has worked well but now I have run into a snag. I have created a local feature branch. I would like to keep this feature branch up-to-date with the latest changes made in dev. Is this possible? I was researching this and […]

How to git checkout a remote branch named the same as a directory?

We have a remote branch named deploy for building and testing deploy scripts. Not surprisingly, the deploy scripts end up in a directory called deploy. Now that the directory deploy is in the branch master, when doing an initial clone it’s cumbersome to actually check out that branch. $ git clone bitbucket.org:/myplace/mything $ cd mything […]

Create a new git repository from a existing local branch

I have a Git repository with two branches: master and redesign. The redesign branch was created from master, and master has not been touched since then: master …|–m50–\ \–m51–|–m52–|–m53– redesign The redesign branch has evolved so much that I would like to create a new whole repository from it, taking the first commit of redesign […]

Git Baby is a git and github fan, let's start git clone.