What's the difference between “Push…” and “Push to upstream…” in Eclipse

When using “Push to upstream…” in Eclipse, the new “local” commits are pushed to remote repository and the remote branch ref is updated in the local repository (so master and origin/master reference the same commit). When using “Push…” and adding a push ref on master in the wizard window (refs/heads/*), the new “local” commits are […]

error: pathspec 'test-branch' did not match any file(s) known to git

I am a new user of Git. I have forked a repository called Spoon-Knife (available for practicing forking with Git). Then, I cloned it locally by running git clone https://github.com/rohinichoudhary/Spoon-Knife.git This repository contains three branches, i.e. master, test-branch, change-the-title. When I run git branch, it only shows *master, not the remaining two branches. And when […]

Why doesn't `git diff` invoke external diff tool?

In my repository, if I type $ git diff some-file or $ git difftool some-file I get the in-terminal diff display. I think this should not happen, because I have set up an external diff tool, as shown by the output of git config -l: $ git config -l user.name=blah blah user.email=blah blah http.sslverify=true diff.external=/home/daniel/bin/git-diff […]

HEAD~ vs HEAD^ vs HEAD@{} also known as tilde vs caret vs at sign

HEAD is a pointer at the current branch. I have seen a variety of notations for ancestors of HEAD including HEAD~2 HEAD^2 HEAD@{2} HEAD~~ HEAD^^ What does each of the above mean, exactly? Where is the documentation for this?

Searching for a file in all git branches

How do I search all git branches of a project for a file name? I remember part of the filename (just the ending) so I’d like to be able to search for something like *_robot.php across all branches, and see which files match that. I’d preferably like to have it search history, and not just […]

git clone without project folder

I have given access to server, and want to clone git repo into my root folder. But when I do git clone it will make me folder with project name, and my project folder is my root. I dont have access to my parent folder my root is /var/www/sites/mysite/ and when I do cloning folder […]

Git warn before committing if string appears in source (or diff)

I would like to be prevented† when staging‡ in a git repo if the changes I am about to commit contain a certain string (say, @todo or @hack). Can someone show me how to achieve this? † or warned. ‡ or when committing.

Is it viable to handle MySQL backups with git?

Today I had this really neat idea for backing up my database: put the dump file in a git repository, then commit on each dump so that I have both the most recent copy, but can easily roll back to any previous backup. I can also easily pull a copy of the repository on a […]

Is it possible to fork a public GitHub repo into an enterprise repository?

There exist a public repo for Quick framework here. I’d like to be able to fork this into a private enterprise github repository. Forking would allow all the branches to remain. the alternative would be to clone the repo and push up only a single branch to the enterprise but then i lose on not […]

Git: set branch to current ref

Due to the use of submodules in my projects I’m finding myself often on “(no branch)”. As I’m also adding code to those submodules I’m committing in there. When I then want to push those submodules I need to be on a branch of course. Hence my question: Is there a way/shortcut in git (command […]

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