Tag: git branch

Working in wrong git branch

I have started working on the develop branch in several files, and then realised that I should have created a new branch for it. I have not committed the changes and the new files yet. so, how can I leave the develop branch as it was (revert?) and then copy the changes into the feature/test, […]

Git branch not detached from an other branch

Hey there, i’m bumping my head against the wall for a while now, i’m trying to understand something with git branches. I have a repository with two branches. Branch A and B, i have done some modifications in my branch A (which are not commited yet) and i would like to create a new branch […]

How to create a GIT branch that point to another branch instead of a commit

Knowing that a branch is a pointer to the last commit. By example, the master branch is linked to the commit C1. I want to know if it’s possible to link a branch to another branch instead of a commit, which would make it a pointer of pointer (for those accustomed in C). By example, […]

Git: how can I exclude just one branch from push?

I’d like to continue to push (almost) all branches with a simple git push command, but there are a few things I’d like to be able to keep in Git locally without sharing them with the rest of the world. The things I’m keeping locally include private changes to public files—hence, I’d like to keep […]

Git Branch Workflow Dilemma

From master, I created a branch A because I wanted to add a new feature. Upon finishing the feature, I committed everything up to this point. But then I kept working on the branch, and now realize all things I have done since that commit would make more logical sense in a new branch, call […]

How to determine master, origin, head

I find myself getting lost in git branches. How can I determine what my origin/master/head is if I’m in an arbitrary git branch? This way I can predict the effects of commands such as those shown here.

How to move my new branch to the latest commit in master branch?

I created a new branch from master branch two days ago. One of my team mates checked in few changes to master branch, instead of the new branch (it should be in both master and the new branch). Now, I want to move the origin of my new branch to the latest commit in master. […]

git – use an existing branch, but copy latest from current branch to it

We have a feature branch (feature) that was used a while ago. The changes from feature were integrated back to the development branch (development). But since then, development has been revised, and feature hasn’t, i.e. it has old code. We are revisiting the same feature and would like to reuse this branch. How do we […]

git pull command output message meaning into which branch

Say there is a remote branch br1 checkout on the remote repo, and the master branch on a local repo. Command 1: If I do a “git pull origin br1:br1” it pulls remote br1 into local br1, and shows: 9188a5d..97d4825 br1 -> br1 9188a5d..97d4825 br1 -> origin/br1 command 2: If I do just a “git […]

How to make git switch to newly created branch automatically?

1: git checkout master 2: git branch feature 3: git commit ‘commit msg’ I am expecting git to switch branch on line 2 (but it doesn’t which is really annoying because I have to revert the check-in on master). Is there any way to make git switch the branch?

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