git

Distributed source control options

I've been interested in Git, but the last time I looked the Windows support was essentially "run Linux". Are there any distributed source control tools that run well on Windows?...

Why is Git better than Subversion?

I've been using Subversion for a few years and after using SourceSafe, I just love Subversion. Combined with TortoiseSVN, I can't really imagine how it could be any better. Yet there's a growing number of developers claiming that Subversion has problems and that we should be moving to the new breed of distributed version control syst...

Version Control. Getting started...

So I know I need to implement version control, even for just the developing I do at home. My issue is I have read about how great Subversion is for the past couple years. I was about to dedicate myself to learning this on the side. But now I am starting to read about Git being the up and coming version control system. So should I hol...

Undoing a git reset --hard HEAD~1

Is it possible to undo the changes caused by the following: git reset --hard HEAD~1 ? If so, how? Thanks....

How do you deal with configuration files in source control?

Let's say you have a typical web app and with a file configuration.whatever. Every developer working on the project will have one version for their dev boxes, there will be a dev, prod and stage versions. How do you deal with this in source control? Not check in this file at all, check it with different names or do something fancy altoge...

How can I set up an editor to work with Git on Windows?

I'm trying out Git on Windows. I got to the point of trying "git commit" and I got this error: Terminal is dumb but no VISUAL nor EDITOR defined. Please supply the message using either -m or -F option. So I figured out I need to have an environment variable called EDITOR. No problem. I set it to point to Notepad. That worked, ...

Migrating to GIT

What are some good resources and tips for migrating from SVN to GIT? ...

Switch branch names in git

There may be more than one way to ask this question, so here's a desciption of the problem. I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. Practically this works fine, I just now have a different branch as...

How can I graph the Lines of Code history for git repo?

Basically I want to get the number of lines-of-code in the repository after each commit. The only (really crappy) ways I have found is to use git filter-branch to run "wc -l *", and a script that run git reset --hard on each commit, then ran wc -l To make it a bit clearer, when the tool is run, it would output the lines of code of the ...

How to "unversion" a file in either svn and/or git

It happens to me all the time. I accidentally version a file, I do not want to be versioned (i.e. developer/machine specific config-files). If I commit this file, I will mess up the paths on all the other developer machines - they will be unhappy. If I do delete the file from versioning, it will be deleted from the other developers mac...

Deploying a Git subdirectory in Capistrano

My master branch layout is like this: / <-- top level /client <-desktop client source files /server <- Rails app What I'd like to do is only pull down the /server directory in my deploy.rb, but I can't seem to find any way to do that. The /client directory is huge, so setting up a hook to copy /server to / won't work very well, it ne...

Good Git repository viewer for Mac

Can anyone recommend a good repository viewer for Git, similar to gitk, that works on Mac OS X Leopard? (I'm not saying gitk doesn't work) Of course I would like a native Mac application, but as I haven't found any, what are the best options to gitk? I know about gitview, but I'm looking forward to evaluate as many alternatives as poss...

Is there anything like TortoiseCVS and TortoiseSVN for git?

I looked briefly, but I didn't see anything right off. Does anyone know anything for ...

How do I restore files to previous states in git?

Given the following interaction: $ git add foo $ git commit -m "Initial import of 'foo'" $ rm foo # This could be any destructive action on foo, like editing it. How do I restore 'foo' in my working copy? I'm looking for something like: $ git <magic> foo Restored foo to revision <blah>. ...

What is the Difference Between Mercurial and Git?

I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git. Has anyone made a side-by-side comparison between git and hg? I'm interest...

How do you organise multiple git repositories?

With SVN, I had a single big repository I kept on a server, and checked-out on a few machines. This was a pretty good backup system, and allowed me easily work on any of the machines. I could checkout a specific project, commit and it updated the 'master' project, or I could checkout the entire thing. Now, I have a bunch of git reposito...

How do you remove a specific revision in the git history?

Suppose you git history looks like this: 1 2 3 4 5 Where 1-5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How to do it? Is there an efficient method when there are hundreds of revisions after the one to be deleted? ...

Should I use GitHub+Fogbugz or Assembla?

I'm trying to work out the lowest friction hosting solution for a bunch of open source, one man (i.e., me) projects. Recently I started using Git and naturally fell into using GitHub as well, which I've found very nice. I also discovered that Fogbugz is free for small teams and started using that for my bug tracking. Recently I've read ...

Git "bad sha1 file" error

Hello I have following error by git-fsck, witch cannot be cleaned by git-gc even in --aggressive mode. What can I do next to fix this repository error? $ git-fsck bad sha1 file: .git/objects/55/tmp_obj_a07724 ...

git-stash vs. git-branch

In a previous Git question, Daniel Benamy was talking about a workflow in Git: I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. He wanted to restore his working state to a previous point in time withou...