How to tell git to ignore individual lines, i.e. gitignore for specific lines of code

This question already has an answer here: Can git ignore a specific line? 7 answers

Git pre-push hooks

I would like to run a unit-tests before every git push and if tests fails, cancel the push, but I can’t even find pre-push hook, there is pre-commit and pre-rebase only.

Can you delete multiple branches in one command with Git?

I’d like to clean up my local repository, which has a ton of old branches: for example 3.2, 3.2.1, 3.2.2, etc. I was hoping for a sneaky way to remove a lot of them at once. Since they mostly follow a dot release convention, I thought maybe there was a shortcut to say: git branch […]

How to prepend the past to a git repository?

I received some source code and decided to use git for it since my co-worker used the mkdir $VERSION etc. approach. While the past of the code currently seems unimportant, I’d still like to put it under git control as well to better understand the development process. So: What is a convenient way to put […]

Can we finally move to DVCS in Corporate Software? Is SVN still a 'must have' for development?

Git/Mercurial have been becoming more and more popular. I have seen plenty of articles comparing SVN with Git/Mercurial, but I am wondering if there is really any reason to still use SVN. It seems like there are plenty of tools for Git/Mercurial now which should help spread its corporate adoption. Are there any reasons to […]

Push local Git repo to new remote including all branches and tags

I have a local Git repo that I would like to push to a new remote repo (brand new repo set up on Beanstalk, if that matters). My local repo has a few branches and tags and I would like to keep all of my history. It looks like I basically just need to do […]

How do I check if a repository is bare?

I’m getting the warning warning: You did not specify any refspecs to push, and the current remote warning: has not configured any push refspecs. The default action in this warning: case is to push all matching refspecs, that is, all branches warning: that exist both locally and remotely will be updated. This may warning: not […]

Git Push error: refusing to update checked out branch

I have solved some merge conflicts, committed then tried to Push my changes and received the following error: c:\Program Files (x86)\Git\bin\git.exe push –recurse-submodules=check “origin” master:master Done remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branch in a non-bare repository remote: error: is denied, because it will make […]

Git checkout: updating paths is incompatible with switching branches

My problem is related to Fatal Git error when switching branch. I try to fetch a remote branch with the command git checkout -b local-name origin/remote-name but I get this error message: fatal: git checkout: updating paths is incompatible with switching branches. Did you intend to checkout ‘origin/remote-name’ which can not be resolved as commit? […]

How to create a new empty branch for a new project

We are using a git repository to store our project. We have our branches departing from the original branch. But now we want to create a small new project to track some documentation. For that we would want to create a new empty branch to start storing our files, and I would want other users […]

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