Tag: git branch

View a file in a different Git branch without changing branches

Is it possible to open a file in a git branch without checking out that branch? How? Essentially I want to be able to open a file in my github pages branch without switching branches all the time. I don’t want to modify it, just want to view it.

Show just the current branch in Git

I tried looking for a special git command for this but couldn’t find one. Can anyone suggest anything shorter or faster than: git branch | awk ‘/\*/ { print $2; }’

Using Git, show all commits that are in one branch, but not the other(s)

I have an old branch, which I would like to delete. However, before doing so, I want to check that all commits made to this branch were at some point merged into some other branch. Thus, I’d like to see all commits made to my current branch which have not been applied to any other […]

Why does git fast-forward merges by default?

Coming from mercurial, I use branches to organize features. Naturally, I want to see this work-flow in my history as well. I started my new project using git and finished my first feature. When merging the feature, I realized git uses fast-forward, i.e. it applies my changes directly to the master branch if possible and […]

Make an existing Git branch track a remote branch?

I know how to make a new branch that tracks remote branches, but how do I make an existing branch track a remote branch? I know I can just edit the .git/config file, but it seems there should be an easier way.

Change a Git remote HEAD to point to something besides master

How do I set a Git remote’s HEAD reference to point to something besides “master”? My project has a policy not to use a “master” branch (all branches are to have meaningful names). Furthermore, the canonical master repository is only accessible via ssh://, with no shell access (like GitHub or Unfuddle). My problem is that […]

Difference between git checkout –track origin/branch and git checkout -b branch origin/branch

Does anybody know the difference between these two commands to switch and track a remote branch? git checkout -b branch origin/branch git checkout –track origin/branch I think both keep track of the remote branch so I can push my changes to the branch on origin, right? Is there any practical differences?? Thanks!

How to fetch all git branches

I cloned a git repository, which contains about 5 branches. However, when I do git branch I only see one of them: $ git branch * master I know that I can do git branch -a to see all the branches, but how would I pull all the branches locally so when I do git […]

How to replace master branch in git, entirely, from another branch?

Possible Duplicate: Change the current branch to master in git I have two branches in my git repo: master seotweaks (created originally from master) I created seotweaks with the intention of quickly merging it back into master, however that was 3 months ago and the code in this branch is 13 versions ahead of master, […]

cleaning up old remote git branches

Here is my git workflow. I work from two different computers (A and B) and store a common git remote in dropbox directory. Let’s say I have two branches master and devel. Both are tracking their remote counterparts origin/master and origin/devel. Now while on computer A, I delete branch devel – both local and remote […]

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