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 […]

Deriving application build version from `git describe` – how to get a relatively straightforward string?

UPDATE I see that this question has become somewhat popular. It’s now years into my admittedly enjoyable Git use, and I have learned a lot since then. Please, pretty please read the last paragraph before going on about your Git adventures with whatever you will have learned from this Q&A. I want to compose application […]

What makes some version control systems better at merging?

I’ve heard that many of the distributed VCSs (git, mercurial, etc) are better at merging than traditional ones like Subversion. What does this mean? What sort of things do they do to make merging better? Could those things be done in a traditional VCS? Bonus question: does SVN 1.5’s merge-tracking level the playing field at […]

Is there a difference between “git reset –hard hash” and “git checkout hash”?

While reset and checkout have different usages most of the time, I can’t see what difference there is between these two. There probably is one or nobody would have bothered adding a –hard option to do something the basic checkout can do. Maybe there is a difference is the way you will see the history?

Git: untrack a file in local repo only and keep it in the remote repo

I have a NetBeans file “nbproject/project.properties” that always shows up in the “Changes not staged for commit” section (when I do git status). How could I move this to the Untracked files section (without adding it to .gitignore) ? I tried this command git rm –cached but what happened is the file shows as untracked […]

Git push won't do anything (Everything up-to-date)

I’m trying to update a git repository on github. I made a bunch of changes, added them, committed then attempted to do a git push. The response tells me that everything is up to date, but clearly it’s not. git remote show origin responds with the repository I’d expect. Why is git telling me the […]

How to perform better document version control on Excel files and SQL schema files

I am in charge of several Excel files and SQL schema files. How should I perform better document version control on these files? I need to know the part modified (different part) in these file and keep all the versions for reference. Currently I am appending the time stamp on the file name, but I […]

How can I tell if one commit is an ancestor of another commit (or vice-versa)?

Git is a DAG of snapshots, with each node on the graph representing a commit. Each commit can have ‘n’ parent commits. Given any two commits, is there a single, concise way to discern the “order” of these two in the DAG. git rev-list seems to be the most promising, but I can’t seem to […]

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