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

5
votes
3answers
3k views

How to execute commands as root in git post-receive hook

I just recently set up a remote git repo on a server for a web app running as an Upstart service. I'd like to use the post-receive hook to trigger actions that are required to update the application ...
5
votes
2answers
2k views

Checkout Git files to a location outside the repository

Is it possible to “checkout” to a location outside of the repository? What I mean is a clone of a branch without the “.git” directory. For example: Use git to manage a website. You edit some files, ...
5
votes
2answers
1k views

Vimdiff and git all at once

I use vimdiff as my difftool with git. Let's say that I've changed twelve files. The problem is that sometimes I run git diff and around the fourth or fifth file I see something that I want to ...
5
votes
2answers
6k views

git pull does nothing / git push just hangs / debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

I had an issue in ubuntu 13.10 and 12.10 where attempting to connect to github (git clone / pull / push or anything) would fail with no output. I checked my /.ssh directory for config and any ssh ...
5
votes
3answers
2k views

Using git, how do I go back to first commit then go through the history?

I cloned a project from Github and now I wish to revert it to the first commit, how would I do this? Also, once I am back to the first commit, how do I go up to the second commit, and then from the ...
5
votes
1answer
5k views

Git log alias - fatal: ambiguous argument '%ad': unknown revision or path

I'm trying to use Git Immersion's log alias: [alias] hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short but Git responds with fatal: ambiguous argument '%ad': unknown ...
5
votes
1answer
329 views

How to store git repos of abandoned projects?

I have over 200 projects on my workstation, every one is a git repository. Most of them are superseded or otherwise abandoned. I still keep the code in case I ever need anything from them. Currently, ...
5
votes
1answer
1k views

What is the difference between git svn init + fetch and git svn clone?

While trying to use locally Git at my workplace where we use SVN I was searching a lot for how to set everything up. From what I found it seems there are two approaches to the problem, either: git ...
5
votes
2answers
1k views

Remove all “deleted” files in Git

Is there a better solution for removing manually-removed files from the Git repository than my current error-prone command? git status | grep deleted: | cut -d: -f2 | xargs git rm
5
votes
2answers
2k views

Installing sha1sum on git-bash (MinGW)

I've been using git-bash on Windows 7 a lot. I gather it is a wrapper of MinGW. It has md5sum but not sha1sum. I'd like to install sha1sum, but I can't figure out how. When I try mingw-get, it says ...
5
votes
3answers
1k views

How to use git annex on an existing repository?

What is the best way to import all big files (or all binary files) into git annex, when they are already in a git repository? I don't want to lose all of my commits, so I think it's not a good idea ...
5
votes
2answers
1k views

I left my .git directory readable by the web server, what risks do I have?

On one of my web applications, I accidentally left the .git directory readable by the web server for the last few weeks. Index listing was disabled. Visiting the website.com/.git URL would result in a ...
5
votes
3answers
3k views

git: Keep changelog for file when moving to a different repository

I am versioning my config files with git. Now I need to move some of my config files to a different repository, to achieve a clean structure. Is there a way I can keep the change log for a file if I ...
5
votes
1answer
229 views

How can I use vim to view git diffs on Windows?

I want to use vim to view the output of git diff. I am running Windows 8 and I have vim 7.4 installed. I have, for convenience, created an environment variable VIMDIR set to Vim's install directory ...
5
votes
3answers
1k views

Can I delete my fork before the pull request gets accepted? [closed]

I made a fork of a project on github, did a small correction and submitted a pull request. However, from every pull request “in line”, I can see that this developer will take a long time before ...
5
votes
3answers
1k views

git-tfs and msysgit on Windows 7

I've installed msysgit [msysGit-fullinstall-1.7.4-preview20110204.exe] on Windows 7 64-bit, and extracted git-tfs [GitTfs-0.11.0.zip] into a directory on my machine. I've setup both the msysgit ...
5
votes
1answer
3k views

keyless public read-only access on gitolite

I was wondering if it was possible to configure gitolite to let anybody clone a repository without having to do the whole public key song and dance. Obviously I don't want people to be able to ...
5
votes
1answer
4k views

How to show what will be updated next pull?

In SVN, doing svn update will show a list of full paths with a status prefix: $ svn update M foo/bar U another/bar Revision 123 I need to get this update list to do some post-process work. After I ...
5
votes
3answers
5k views

How can I make git commit files in a symlinked folder

I have two folders: /home/me/code/project/ /srv/www/projectfiles/ In the /home/me/code/project folder, I have symlinked static to /srv/www/projectfiles/ i.e. /home/me/code/project/static/ -> ...
5
votes
2answers
2k views

Git and sub repositories

Is there anyway to force git to include files and directories in other repositories that are residing somewhere within the current repository? The reason I ask is that I have a layout that is ...
5
votes
3answers
1k views

Is there a way to redo a merge in git?

So I made a pretty big mistake. I made a commit, pulled, merged (but messed up the code while doing so) and then pushed. I'd like to redo that merge and get the code right. Is there any way to do ...
5
votes
1answer
1k views

Right and fast way to test git directory and git branch?

While trying to set up my new fish shell prompt, I ended up testing ways to get the branch name and also testing if I was on a git repository. I have found (1) git rev-parse --abbrev-ref HEAD, (2) git ...
5
votes
1answer
1k views

git gc out of memory

I have to clean-up my git repository with git gc. Unfortunately I do get a fatal out of memory error. ernst@samson:~/htdocs/stockdoo$ git gc Counting objects: 42368, done. Delta compression using up ...
5
votes
2answers
934 views

Eclipse: Help with EGit

I want to be able to use a version control system. Although Eclipse comes with CVS, I think it's better that I use a distributed version control system, such as GIT. I was pretty much sold after ...
5
votes
1answer
355 views

SSH freezing with ControlPersist on

I recently enabled ControlMaster and ControlPersist in SSH so that it reuses and multiplexes connections for speed. The config is: ControlMaster auto ControlPath /tmp/ssh_mux_%h_%p_%r ControlPersist ...
5
votes
1answer
1k views

Gist vs repository on GitHub [closed]

Say you have a couple of projects that you want to host on GitHub, and they're all pretty small (i.e. each one is a single bash script with less than 100 lines). Even though they're relatively small, ...
5
votes
1answer
251 views

How can I get SVN to recognize Mac Bundles as ASCII instead of Binary Streams?

I have a keynote file in which I am regularly editing the text, moving slides around, etc. There are a max of a few kilobytes of data changed in the internal .key XML file. However, SVN recognizes ...
5
votes
1answer
235 views

How to filter commits by author in SourceTree?

In the branch view of SourceTree, I see all the commits. I'd like to filter the commits to show only the ones committed by me/someone. How can I do this? Thanks.
5
votes
1answer
7k views

How to troubleshoot “remote end hung up unexpectedly” error in Git

I setup GIT in a Windows and a Ubuntu. Both of them works well locally. Now I want to put some repository from Windows to Ubuntu. I think I can use 'git push' in the Windows, or use 'git clone' in the ...
4
votes
5answers
5k views

Setting up SSH/Git on Cygwin yields “Bad permissions on ~/.ssh/config”

I'm attempting to setup Git with OpenSSH under Cygwin. I almost got everything setup. I have the agent and public key and all that.. but now I get this really weird error: $ git pull -u origin master ...
4
votes
1answer
12k views

Git remote add doesn't work

I'm trying to add a remote server from my git bash prompt with something like: git remote add origin ssh://myserver.pair.com/usr/home/myname/myrepo.git fatal: Not a git repository (or any of the ...
4
votes
2answers
7k views

Is Git Shell Windows Power Shell?

I have a simple question. What is Git Shell? IS it the same as Windows Power Shell? Because when I run Git Shell on my Windows 7 machine the Windows Power Shell is opened. Thanks for clarification. ...
4
votes
3answers
797 views

Add as if from the root folder of the repository

This has caught me up a couple times. I have a terminal open inside a GIT repository. I do git status to see all the changes across the repository. I then do git add -A, git commit -m "Some text" and ...
4
votes
2answers
11k views

gitosis: list all repositories

Is there a way to get a compact list of all git repositories managed by gitosis. I'm looking for something similiar to svn list url_to_repo I know that I can have a look at gitosis.conf, but ...
4
votes
3answers
7k views

How to install the latest Git version on Ubuntu 10.10?

Synaptic just gives me version 1.7.1, but I want version 1.7.3 without the need to download and build from sources.
4
votes
2answers
142 views

when checkout a previous commit, Is there a quick way to input the log commit hash?

It's really tedious to type the following command: git checkout 622fe0a9b6bffdf4723026ae6e673245b510ac66 Is there autocomplete or shortcut to do this?
4
votes
2answers
17k views

Mac OS X Terminal get in Macintosh HD? For using Git and Github

I wanted to get started with using Git and Github especially for installing Web software to my htdocs directory. htdocs is the folder in which you put all your websites that then run by using MAMP -- ...
4
votes
3answers
5k views

How to git clone private repos within Vagrant VM, using host's SSH keys?

I'm able to use PuppetLabs vcsrepo to clone public git repos, but I'd like to also be able to clone private repos, using the host's SSH keys. What would the configuration look like for Vagrantfile ...
4
votes
1answer
4k views

GIT Overwrite branch with master

I have an old dev branch that is completely outdated. I don't want to remove it but I do want to replace its contents entirely with the master branch. Meaning, I want dev_branch = master I tried: ...
4
votes
2answers
4k views

Git — SSH Agent not working

The back story -- I've been using Git on this computer (Windows XP) for about 8 months with no problem. Suddenly, last week, it is no longer asking me for my username and password when I start Git up. ...
4
votes
4answers
7k views

Why is Git falsely noting that my files are up-to-date?

I have 2 folders A and B in my file directory that link up to the same Git repository. I created a file in folder A called "index.html". I then create a different file also called "index.html" in ...
4
votes
1answer
3k views

How to set to pull the same branch by default?

When I pull from the new added remotes, I have to specify the branch name explicitly: $ git pull remote1 ... Error: you didn't specify a branch name. $ git pull remote1 master Though I'm working ...
4
votes
2answers
5k views

Can checkout and track git branch, but cannot pull

So we have a branch in our git repo called creative_market. I run the command git checkout --track origin/creative_market which works fine. All of the changes that should be on the creative_market ...
4
votes
1answer
3k views

git hard links - does it know a file is a hard link?

I started using hard links instead of symbolic links to organize files ... I've been doing this for pictures I take to categorize them as well as indicate which ones I want to print, etc. I'm using ...
4
votes
1answer
730 views

Error while installing Perl package Term::ReadKey in Cygwin

I'm trying to use git via cygwin Well, I used this command to clone the svn content to a local git repository: git svn clone svn://path/to/my/project --username myuser Git was returning: ...
4
votes
1answer
3k views

What command does “Sync Branch” do on Github application

As the title suggests, which operations does the "sync branch" perform on the github application for OS X? Does it do a full clone of the repo again?
4
votes
1answer
976 views

How do I point GitHub for Windows to my existing repository folders?

I installed GitHub for Windows, and it's a very smooth program (looks exactly like any of the Live programs). However, it lists my GitHub repositories and wants me to clone it to ...
4
votes
1answer
106 views

Using su with commands

Ubuntu Server 12.04 On a remote server that I ssh into I have set up a special user with: sudo adduser --system --disabled-login --disabled-password --group suser to run some maintenance functions. ...
4
votes
2answers
506 views

What to use for long term data archival?

I like to archive everything. Currently a small box of CDs holds most of my work and downloads from the past 15 years. Unfortunately, some of the CDs are starting to suffer bit rot, resulting in ...
4
votes
2answers
622 views

Which SCM is less disk intensive? (GIT vs SVN vs others)

I wonder which of the pouplar SCM's (especially I am interested in GIT, SVN) is less disk intensive. The thing is that, I was going to get an SSDisk (SSD) ) and they have limited write cycles. And I ...