Tag: git branch

Why doesn't the graph display a new branch branching off from the master branch, when I create a new branch in terminal?

Why doesn’t the graph in Sourcetree display a new branch branching off from the master branch , when I create a new branch called “testing123” in terminal ? Sourcetree recognises the new branch but it doesn’t branch off from the master branch in the graph. Why is this happening ? How can I make Sourcetree […]

git-flow: how to checkout release branch from origin?

What is the perferred workflow to pull a published release branch from the central repo using git-flow? eg: Mike made a release branch, he published it through “git flow release publish 1.0″ Jane would like to work on that release branch too, how does she pull it from the central repo to continue working with […]

git switch branch without discarding local changes

Alright, lets say one day we make happen to make a bunch of modifications and when we go to commit them we notice we were working on the wrong branch. How can we force git to switch branches without discarding local changes. I’m probably going to go about this in a naive way while I […]

Git: How to “undo” a merge

The situation: Starting with the Master at A I branched and made some changes at B then merged that branch back in (C). After making some more changes I was at D but found I needed to deploy the code without the changes that happened in the branch. If I hand’t merged it that would […]

Override author on git merge

Is there an option like –author of git-commit for git-merge? We maintain a staging environment where some changes must be performed. Some limitations make us to use only one linux user to access staging environment. Anyway, we are a small team with cooperative initiative and we tell when doing commits, which one is the author […]

getting git branches of a certain age

My organization is using git branching extensively. As a result, we have produced over 2000 branches in the past year. We are now trying to adopt a strategy for cleaning up all the old branches that are of some given age. I know how to delete branches, but I can’t find a straightforward way to […]

Keeping a branch up to date with master

I have a remote repository that I’ve pulled and am branching from. I want to keep the new branch up to date with changes done to master. I’m thinking about the workflow below, does it make sense or are there are better ways to do this? Initial branching and checkout: git checkout master git pull […]

How to work simultaneously on a few branches

This is a follow-up on this question on creating branches. It strikes me as odd that I would still work on one repository because the files on my local machine will be a weird mix of different experiments. I would imagine the best-practice method is to duplicate the repository and work in different folders on […]

How do I shallow clone a repo on a specific branch?

How do I shallow clone a git repository, so that my clone contains only 1 history item, and starts on a specific branch? I know how to do a shallow clone: git clone –depth 1 https://path/to/myrepo.git but not start the clone on a specific branch.

How to cherry-pick the last sha from another branch in Git with 1 command?

I find myself doing this a lot when cherry-picking a commit from another branch. $ git log -1 another_branch commit <commit_sha> // copy <commit_sha> $ git cherry-pick <commit_sha> Can I do all of this in one command, if so, what is it?

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