Git is an open source distributed version control system originally designed and written by Linus Torvalds. It is generally used to keep track of source code for software projects. As a DVCS, Git provides powerful help with branching, merging, and distributed development.

learn more… | top users | synonyms

11
votes
2answers
5k views

Homebrew won't link git

When I installed git or upgrade git via brew I couldn't link it with brew link git. If I try sudo brew link git I get: cowardly refusing to sudo brew link It says that I have to check the ...
11
votes
1answer
2k views

How can I selectively disable zsh's version control integration when my CWD is on a remote filesystem?

I'm running zsh on OSX and on occasion I have to work on a mounted sshfs volume. However, git is REALLY slow over sshfs mounts. My prompt makes use of the vc mode stuff that zsh provides built in, but ...
10
votes
3answers
5k views

Despite the fact that GIT does NOT store file deltas, can you still rollback to previous file versions (unlimited times?)

I've read that Git does not store file deltas. If this is true, how does it support file rollback to previous versions? If it's storing the entire file the repository space on disk must grow to be ...
10
votes
2answers
12k views

Git: How to delete all untracked files?

I'm using Git for version control. Now I want to delete on my local machine all files in the repository that are not tracked. I can use git status to list these files, but how can I delete all of ...
10
votes
2answers
18k views

Connecting to github using PuTTY generated SSH key in Windows 7

On an otherwise pristine Windows 7 Enterprise install: Install PuTTY 0.62 Create public/private key pair with puttygen.exe Add public key for pasting into OpenSSH authorized_keys to github account ...
10
votes
2answers
6k views

How to have Sublime Text 2 show git folders and files in the sidebar?

When adding a folder to a Sublime Text 2 project, it doesn't seem to show .git subfolders. It also seems these files cannot be opened by Ctrl-P. I disabled the Git plugin but that didn't help.
10
votes
1answer
9k views

Problem using git on Windows 7 with msysgit and .ssh keys

I'm using git on my Ubuntu machine with my existing ssh keys. Now I have to use Git on Windows 7, and need to use the same keypairs. I have set up msysgit and created an .ssh folder in ...
10
votes
3answers
10k views

How do I access a git repository on a samba share?

I have a Samba share set up that I'd like to put a git repository on. I've tried searching google for the best way to use git on a Samba share, but it seems difficult to find anything on doing this ...
10
votes
4answers
1k views

How to track $HOME with git

I would like to track my $HOME dir with git. I've got many other git repos in other subdirs (eg $HOME/projects/repo_1 and so on), which shouldn't be tracked, since they already are. I have found ...
10
votes
1answer
2k views

GitHub for Windows can not sync to repo while command line tools can

I have my git repos hosted on a server using Gitolite. I can access them using SSH like this and it works from Mac OS X/Linux: git clone git@example.net On a Windows 8 Box I now have installed ...
9
votes
2answers
3k views

I need sudo without password prompt, for scripts. Where did I go wrong?

I am in sudo group all right: $ id uid=1002(molot) gid=1002(molot) groups=1002(molot),27(sudo),33(www-data) In my sudores I seem to have appropriate setting: sudo ALL=(ALL:ALL) NOPASSWD: ALL ...
9
votes
2answers
4k views

Colors in git output?

I have seen some examples on people getting colors in git output. I tried the following guide http://scie.nti.st/2007/5/2/colors-in-git but unfortunately it didn't succeeded. Is there anything else ...
9
votes
4answers
5k views

Can you remove a file from Mercurial without removing it from the filesystem like Git?

I've got some files in a repo that I don't want tracked, is it possible to remove them without removing the actual files from the filesystem? This would be equivalent to git's rm --cached.
9
votes
1answer
2k views

ZSH tab completion of git commands is very slow. How can I turn it off?

If I type: rm <TAB> I'll see possible completions almost instantly. However, if I type: git rm <TAB> It'll hang for several seconds if it's in a git repo, or fail to show any ...
9
votes
2answers
1k views

Is there a way to run git within Powershell?

Is there a way to run git within Powershell? I have a Windows 7 box with msysgit. I'd like to have a single shell to also run all my git commands as well as play around with Powershell scripting.
9
votes
2answers
1k views

Change tabsize in git-gui

I was wondering if it's possible to change the tabsize in git-gui from 8 characters to 4. The only thing I found was core.whitespace = tabsize=4 but that only affects diff. The reason why I'm asking ...
9
votes
3answers
6k views

Homebrew installation of git won't take precedence over system version (in /usr/bin/)

OS X (or Xcode) comes bundled with git 1.7.something, but after brew install git (1.8.0), which git keeps returning the old /usr/bin/git. This is what I get when I echo $PATH right now: ...
9
votes
1answer
5k views

SSH config - same host but different keys and usernames

I've set up two GitHub accounts, but I can't get ssh keys to work correctly. I've tried various configs. Host github_username1 HostName github.com IdentityFile ~/.ssh/rsa_1 User ...
9
votes
2answers
3k views

Tweaking zsh git autocompletion

I just switched from bash to using zsh 4.3.4 on Ubuntu Hardy. I'm developing with git and I find myself constantly fighting with the default git completions: filename completion tries to be smart by ...
9
votes
1answer
7k views

How can you avoid being asked to enter your BitBucket password when you push to BitBucket wiki?

I'm not sure if everyone experiences this - when I edit a BitBucket wiki locally (through a git repository) I have to enter my BitBucket password for every pull and push. Is there any way around ...
9
votes
1answer
3k views

Does git-clone have resume capability?

Does the git-clone command have resume capability? If it gets interrupted while I'm downloading a large repository will it resume if I give the same command again?
8
votes
3answers
8k views

How to delete the git reference `refs/original/refs/heads/master`?

What's this in the yellow round box? I've tried git branch -D, git tag -d but none succeeded. So how to delete it?
8
votes
4answers
7k views

Using git as a central repository

I have set up git for my own use--so I can access a project from 'anywhere', and keep version safety if I happen to be working on part X over here, and part Y over here, and can merge if necessary. ...
8
votes
1answer
8k views

Cloned GitHub repos ask for a password, while originally created don't

I've just lost a bunch of repositories from my disk, so I've cloned them from GitHub. These are now asking for username and password each time I push something to GitHub. Those that haven't been ...
8
votes
5answers
17k views

Installing Git on CentOS [closed]

How install git on CentOS? I find this manual. Is it good?
8
votes
2answers
8k views

How to view only the unmerged files in git after a merge failure

While merging some of the files failed to merge. git status shows both the successful and failed merges. How to view only the unsuccessful merge files(conflict). Currently i am using the ...
8
votes
1answer
2k views

Find recently added files with git

I want to get a list of the most recently added files using git. Is there any sane way to do this?
8
votes
4answers
6k views

Removing git from /usr/bin

I'm on OS X 10.8 and I'm using Homebrew. brew doctor tells me that I have 2 git installations, one in /usr/bin and the other one in /usr/local/bin. Is it a bad idea to remove git from /usr/bin? If ...
8
votes
2answers
5k views

How to setup own GIT Server? Whats bare/non-bare repos?

I am trying to setup a simple GIT server. I have Ubuntu installed on a Virtual PC (Virtual Box). I installed GIT, created a repo etc git init git add . git commit "..." Then on Windows, I did ...
8
votes
2answers
3k views

How do I use installed Vim in Git Bash instead of the one that came with Git?

I've installed Vim and Git to C:\Program Files (x86)\(vim|git) respectively. When I run Vim from Git Bash, it runs the internal version of Vim that came with the Git installer. Is there a way to ...
8
votes
3answers
7k views

Git chmod problem: Checkout screws exec bit

Under Ubuntu and Debian the last committed files are getting the execution bit set, when I try a checkout afterwards. It's quite strange and driving me nuts: $ ls -l file -rw-r--r-- ... file # on ...
8
votes
4answers
3k views

Where should I put my Git repository?

I have an Ubuntu box at home, and I want to have a directory that has all (more or less) my Git repositories. Eventually (when I get some team projects at school this year), I'll want have some of the ...
8
votes
3answers
2k views

Adding git branch to bash prompt on snow leopard

I am using this: $(__git_ps1 '(%s)') It works however it does not update when I change directories or checkout a new branch. I also have this alias: alias reload='. ~/.bash_profile' Sample run: ...
8
votes
1answer
3k views

vim not loading _vimrc file when launched from git bash

I have downloaded and installed git for windows (msysgit) and frequently used the included git bash. Whenever I run vim from git bash my _vimrc file is not loaded because there is syntax highlighting ...
8
votes
1answer
30k views

another “SSH connect to host github.com port 22: Bad file number”

I have a problem with my first-time SSH connection. Yes, I've already done your guides, already tried your "Dealing with firewalls and proxies" article and the problem is still occuring. I am using ...
8
votes
2answers
2k views

gVim as git editor under cygwin

I use msysgit and I'd like to have gvim as my git editor. I use cygwin bash instead of git bash. Running $ /cygdrive/c/Program\ Files\ \(x86\)/Vim/vim73/gvim.exe starts gvim. But if I set this ...
8
votes
3answers
3k views

Vim powerline doesn't show the current branch

I'm using the vim plugin called powerline and it isn't showing the git branch I'm on, while it's supposed to be activated by default. The fugitive plugin is installed, though I don't think it was ...
8
votes
1answer
6k views

How to tell dropbox to ignore git files?

I have been keeping my vim files in Ubuntu One and since I have a lot of plugins installed as git submodules (or however vundle installs them) and I'm only interested in updating these repositories on ...
8
votes
3answers
4k views

Git corrupt master branch

I open my Git repository using gitExtensions on Windows 7 for a Visual Studio project. It is suddenly empty. The repository exists, but all my commits have disappeared. I am using the graphical ...
8
votes
2answers
6k views

Getting remote git commit log without local copy

I want to get a copy of the commit log from a remote GIT repository without cloning/pulling it to my local machine and using only SSH. Is this possible? For example, I want to do something like: git ...
7
votes
8answers
3k views

Using Git to Manage An iTunes Library?

I've been considering using Git to manage my iTunes library and allow me to sync it between computers. Can you think of any reasons why this would be a bad idea?
7
votes
2answers
6k views

Trouble getting latest version of Git

I am using Ubuntu 10.04 LTS. I'm looking at using git as source control for personal projects and Github as a remote repository. I was having trouble pushing a commit to my remote github repo getting ...
7
votes
1answer
2k views

How to have .git folders ignored by Eclipse projects

Whenever I use eclipse on a folder with a .git folder, the .git folder is included in project wide searches and it is displayed in the Navigator view. Is there some way to: Make sure that .git ...
7
votes
1answer
11k views

How can I merge two branches without losing any files?

I have two branches with the following files in there: branch a: file_a file_b file_c branch b: file_a file_d file_e I want to merge them, so that I get both files from a and b (and files that ...
7
votes
3answers
5k views

How to upgrade to latest git on debian 7?

I have installed git through apt-get on debian 7 which gives me: # git --version git version 1.7.10.4 I would like to ugrade to the latests version of git. I have tried: sudo apt-get install ...
7
votes
1answer
1k views

How do I resolve the git-svn error 'refs/remotes/git-svn$: command returned error: 1'?

In the process of converting a Subversion repository to git, you might encounter the following error while converting svn:ignore settings to .gitignore: config --get svn-remote.svn.fetch ...
7
votes
1answer
3k views

Using the IdentityFile directive in ssh_config when AgentForwarding is in use

Is it possible to specify forwarded keys using the IdentityFile directive in .ssh/config? I ran into this quirk when trying to deploy some code via Capistrano/GIT on our production server. Both my ...
7
votes
1answer
700 views

What is an equivalent of git rm -r … in the emacs magit package?

I want remove some folders from my repository and I can do it as usual with git rm -r junk-folder But how I can do this from emacs with magit package?
7
votes
2answers
1k views

Is it safe to delete a branch from a github fork once it's been merged upstream?

I've only recently tried my hand at forking in github and would like some "best practice" advice. I created a branch in my fork, and that branch got pulled into master of the upstream project. It no ...
7
votes
1answer
1k views

Git equivalent to hg update

I've used Mercurial for some time now, and am used to its workflow. Suddenly, I need to work with a Git repository, and I cannot make the install work from the head revision. In Mercurial I would ...