Color in git-log

When you run git log –decorate –pretty=oneline the output will have entries like (HEAD, refs/published/master, master) with coloration. I also have the following in my gitconfig: [color “branch”] current = yellow reverse local = yellow remote = green How do you replicate those colors when doing a custom format like the following? git log –decorate […]

Best way to add Gradle support to IntelliJ Project

I have looked around quite a bit and haven’t found the best solution to convert an existing IntelliJ project to Gradle. I work in a team environment and we currently share the .ipr file as we have a few build configurations that we track. We will be getting rid of those in favor of Gradle […]

Git checking out problem

I’m running a Ubuntu (9.10) server with Git (latest from Ubuntu package manager) installed. Access to the Git is via SSH. On windows machines, I’m using Cygwin to push/pull code. I can push my project code onto the server but when I do a clone or pull, it returns a [fatal: early EOFs] error at […]

How to update a git clone –mirror?

I have created a git repository to mirror a live site (which is a non-bare git repository): git clone –mirror ssh:// Now, to keep this mirror clone updated with all changes from its remote origin, which command or commands I must use? I’d like to keep everything updated: commits, refs, hooks, branches, etc. Thanks!

Using conditional configuration files with Git

I frequently find myself changing a single variable in my project within Git to connect to a different server while on the Development branch (in JavaScript, so I can’t use preprocessor defines). Is there some way in Git that I can conditionally use one file or another depending on what branch I’m on? I can’t […]

What's the best practice for putting multiple projects in a git repository?

As some reason, I only have one repository to use. But I have multiple projects including java projects, php scripts and android apps. Now my problems is, I have to put them to different sub-folders for each projects; and for php projects and java projects, I use different IDE. You know, each IDE can have […]

How do I react to new tags in git hooks?

I’d like to set up a git hook that creates a CDN-style directory structure based on incoming tags. So, for example, if the last tag in the local repository is “v1.2.1” and I pull a commit with “v1.2.2”, it should see the new tag and clone the repository into a new directly (../1.2.2) accordingly. I’m […]

git update-index –assume-unchanged and git reset

Here is the scenario: In my working directory, I have a number of files (let’s call them A,B,C) that I’ve edited. I then ran git update-index –assume-unchanged on those files. Now git status returns blank. Good. Now, if I do a git reset –hard, the contents of the files A,B, and C, revert back to […]

'receive-pack': service not enabled for './.git'

(Solved already, I’m writing this for the next guy) I was running git daemon on one computer and tried synchronizing with another. On computer A, I ran: git daemon –reuseaddr –base-path=. –export-all –verbose On computer B, I ran: git clone git://computerA/.git source # worked cd source git pull # worked git push # failed with […]

How to remove files that are listed in the .gitignore but still on the repository?

I have some files in my repository that should be ignored, i added them to the .gitignore but, of course, they are not removed from my repository. So my question is, is there a magic command or script using filter-branch that can rewrite my history and remove all these files easily? Or simply a command […]

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