Git revert not bringing back the earlier state

So a long time ago I added a folder abc with a group of files in it to my project and made a commit with revision xyz. After many commits someone has erased the folder with git rm -r abc. After this there has been a lot of commits as well. Now I need to […]

git remove branch without removing commits

I have two branches I normally work on: master and homepage_buildout. I was recently told to checkout an old commit from before I was working on the project. I simply did: git checkout [commit number] Then I decided to make this old commit a branch like so: git checkout -b old_homepage Now, I realized that […]

VCS and single developer “team”

I am a single developer working on a project for my company. I use subversion and Trac (for bug-tracking and communication with management types). I have a staging server and a production server. Today I checked in some code and discovered that my FSFS-based svn (v1.4) repository is irreparably corrupt. While this is quite a […]

What's the best way to change the working tree to a specific commit before bisecting?

My usual workflow when starting a git bisect session is: git bisect start # start a bisect session git bisect bad # I noticed that the current state is broken Now, often I know that things worked in the past, but I don’t know yet which version was good, so I usually want to revert […]

Undoing a git push from a different computer

Ok, so I work on a project from home and work using 2 computers with a remote repo. When I got home today, my home computer was 2 days behind my work computer and I did a git push origin master accidentally which has screwed up the remote repo (newly cloned code is now broken). […]

Git commits found in master, not shown when viewing log of specific file

We’ve got a repository that has only a master branch (for the purpose of this discussion). Somehow we’ve got to a situation where a developer has merged his local master and pushed and managed to lose other commits. The situation is that for a few commits, if we run git log from the root of […]

How to create a branch under another branch in git?

I’m just curious, because I’ve noticed that some repositories have their branches setup like this: git branch -a master remotes/origin/branch1 remotes/origin/branch2/lala remotes/origin/branch2/yay remotes/origin/branch3 remotes/origin/branch4 I’m just curious how they do the branch lala and yay under branch2; or is that not a branch? Any insight?

Prevent an untracked file from being overwritten in Git

Say I have two branches, master and b2. In the specific directory where the git repository is, there are many files not tracked by git and some that are tracked by git. I did some work in branch b2, and now I tried to switch back to master using git checkout master. I get an […]

Multiple “git add” before “git commit”

Here is my experiments. git init echo hello > some.txt git add some.txt — objects — f2 (blob “hello”) echo hola > some.txt git add some.txt — objects — f2 (blob “hello”) — 53 (blob “hola”) git commit -m “…” — objects — f2 (blob “hello”) — 53 (blob “hola”) — 5c (tree “some.txt” -> […]

git non-fast-forward error

I’ve reverted to a previous version of my commit then I’ve done some other commits but without pushing to the remote repo. When I do push I got the following error: To git@xxxxxx ! [rejected]        REPO -> REPO (non-fast-forward) error: failed to push some refs to ‘…..’ To prevent you from losing […]

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