Tag: branch

Deleting a local Git Branch that was never pushed – delete it on the server, too?

I made a local branch, but then realized that I do not need it. If I delete it from the local repo, will I have to delete from the remote, too? I just made that branch and did not add, commit or pushed anything into it – in short I did not do anything in […]

Am I looking at GIT branches in GIT clients wrong?

When I work with GIT branches my “mental model” of any given branch is that it is a path which breaks out from the branch which I base that branch on. Let’s assume I do the following : git checkout develop git checkout -b feature/1 touch README.md git add –all git commit -m “Added README.md” […]

Development and testing branch in @nvie's Git branching model?

I’ve read about @nvie’s Git branching model and gitflow and I think this is a good model to use for a project (web application) I’m currently working on. I’m the lead developer of the project and I develop on a local environment (MAMP-like). Whenever I’ve made something to show the client, I commit my work […]

Which branch was this commit in?

This question already has an answer here: How to list branches that contain a given commit? 2 answers

git branch | grep '^SomeThingInFrontOfLine' not working

I have a lot of git branches, I want to search only those begin with certain letters i.e $git branch branchA.abc.1234567 branchA.cbc.1234457 branchB.cbc.1234457.branchA.backup branchC.cbc.1234457.branchA.backup And i want to only search those begin with ‘brnachA’ $git branch | grep ‘^branchA’ But the above command returns nothing, any suggestions?

How do I determine what branch/tag I have checked out in git?

I clone my source using git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git w/. Then I specify a specific branch/tag by doing git checkout <tag name> or git checkout origin/REL<release number>. Sometimes I forget what branch or tag I’m on. In SVN I would do a svn info to figure out what branch/tag I’m using (I realize that git has […]

Separate clones, or separate branches

Hi guys : Im not particularly excited about git branches, but my organization uses them heavily. In any case, I need to work on a branch of head. In the past I have “switched” branches while developing in a single place, however, I feel like this gets confusing. Is it common/idiomatic in git to simply […]

Checkout branch on different remote

I have a repo that has another remote upstream besides origin. I can do git checkout origin/master, but when I run git checkout upstream/master, I get: error: pathspec ‘upstream/master’ did not match any file(s) known to git. This does not work either: $ git fetch upstream From https://github.com/getsentry/sentry * branch HEAD -> FETCH_HEAD $ git […]

How can I view original branch of commits (and file changes) using git log?

I read a similar question about this that suggested using git log –graph –all –decorate. The problem with this is that it doesn’t display branch names for log entries that have had their branch merged and deleted long ago. What I’m interested in is basically the exact same thing as the straight git log command, […]

Use forever-branches or directories for project related documentation, wireframes, designs, etc.?

I’m investigating how best to organize a git repo to store both a project’s code base as well as related documentation such designs, wireframes, stories, etc. I’m wondering whether it would be better to use dedicated directories such as “designs”, “wireframes”, vs using “forever-branch(es)” ie. branch(es) that will never be deleted such as “designs”, “wireframes”, […]

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