How do I add a submodule to a sub-directory?

I have a git repo in ~/.janus/ with a bunch of submodules in it. I want to add a submodule in ~/.janus/snipmate-snippets/snippets/, but when I run git submodule add <…> in the snipmate-snippets directory, I get the following error message: You need to run this command from the toplevel of the working tree. So the […]

How to git reset –hard a subdirectory?

UPDATE: This will work more intuitively as of Git 1.8.3, see my own answer. Imagine the following use case: I want to get rid of all changes in a specific subdirectory of my Git working tree, leaving all other subdirectories intact. I can do git checkout . , but git checkout . adds directories excluded […]

How to setup GIT bare HTTP-available repository on IIS-machine

server already runs IIS to serve 80 and 443 port over TCP. I want to make centralized “push/pull” GIT repository available to all my team members over the Internet. So I should use HTTP or HTTPS. But I cannot use Apache because of IIS already hooking up listening sockets on 80 and 443 ports! Is […]

Visual Studio Git Source Control without Git for Windows or Github extension

In Team Explorer it prompts me to install 3rd party git tools, I don’t intend on using the Git command line, just Visual Studio’s native GUI to clone, pull, commit, sync, merge and maybe issue pull requests. So do I need to install 3rd party Git command prompt tools (or Github extension)? because I already […]

Git push failed, “Non-fast forward updates were rejected”

I’ve edited my GIT repositories via Git Online. After I tried to push my local code changes, I got an error: Git push failed, To prevent from losing history, non-fast forward updates were rejected. How can I fix this?

Pushing from local repository to GitHub hosted remote

I created a local repository of my Visual Studio 2010 solution folder using Git GUI on my dev machine. I then created a remote repository in my GitHub account. Now, I am looking for how to push my local repository to the remote repository. In SVN I can just commit using TortoiseSVN and changes are […]

Git: Merge a Commit into a different Branch

So I have 3 branches; develop – my continued development branch version_1 – a release branch version_2 – a release branch I had to do a hotfix on version_2 to reship that version, it was a 2 line change in 2 files, very small. I wanted to apply that fix to version_1 and develop. So […]

How to wrap git commit comments?

Is there a way to wrap git commit comments (when viewed via git log), so they are not cut off at the end of the line? It seems like there should be a pretty simple solution, but I haven’t been able to find one. Thanks.

Git checkout/pull doesn't remove directories?

I’ve got my repo @ github. I did some work at home and pushed it to github. It involved some deleting of files and directories. Now I’m on my work box, which had a copy of the code before deleting the files and directories. I issued the following: git remote update git checkout HEAD git […]

How do I “undo” a –single-branch clone?

I cloned a repo using the git clone -b <branch name> –single-branch <github url> <target directory> This cloned ONLY this branch, but now I want to switch to the master and other branches. Is there any way besides clearing it out and starting over to clone the rest of the repo that I can undo […]

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