Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

learn more… | top users | synonyms

4
votes
1answer
154 views

How does this git alias work?

Usually, git aliases are confined to a single command: git config --global alias.ci commit So, instead of git commit you could do git ci But it seems you can insert a function in there as well: ...
2
votes
1answer
612 views

watch command not showing colors for 'git status'

I'm trying to get watch to display colors from 'git status'. I've tried running watch with the --color option, as suggested elsewhere here, but, still, watch --color 'git status' doesn't display ...
19
votes
5answers
2k views

Are there pitfalls to putting $HOME in git instead of symlinking dotfiles?

I have for many years had my entire $HOME directory checked into subversion. This has included all my dotfiles and application profiles, many scripts, tools and hacks, my preferred basic home ...
3
votes
2answers
174 views

place the aliased version of an existing command in /usr/bin/

I use Vim a lot, and I know how I can start vim in insert mode. So I have an alias named vii in my .bash_aliases file. On other hand I use Git a lot too, and I have this line in my .gitconfig: ...
4
votes
1answer
625 views

Git auto-complete

I am using Git as many of you do. Also, I don't use any GUI for that — just CLI. So I was wondering: are there any way to make Git commands (git status, git checkout etc.) complete themselves when ...
11
votes
3answers
1k views

Given a git patch id, how to find out which kernel release contains it?

Assume I have some issue that was fixed by a recent patch to the official Linux git repository. I have a work around, but I’d like to undo it when a release happens that contains my the fix. I know ...
4
votes
1answer
104 views

Invoke git without loading user gitconfig

A git-interfaced tool written in Python breaks because of some settings in my local ~/.gitconfig, namely diff.noprefix=True. I know that I can use something like git -c diff.noprefix=False diff in ...
7
votes
2answers
321 views

Git do not overwrite symlinked directory on branch checkout

How can I make directory read-only with git? The situation is - in project, I have a symlink to shared framework. I don't want it to be overwritten/changed in any way (not even mtime or atime). How ...
27
votes
4answers
9k views

How to colorize output of git?

Is there a way to color output for git (or any command)? Consider: baller@Laptop:~/rails/spunky-monkey$ git status # On branch new-message-types # Changes not staged for commit: # (use "git add ...
0
votes
1answer
252 views

Giving input to background processes

Is there any way to give input to background processes or which run as daemon processes? I was coding some Puppet configuration files and I had to push them to some remote machine. For that purpose I ...
10
votes
2answers
679 views

Can git configuration be set across multiple repositories?

Git seems to support configuration values at three levels: Per-system global settings (stored in /etc/git-core) Per-user global settings (stored in ~/.gitconfig) Per-repository local settings ...
1
vote
1answer
393 views

Crontab with SVN and Git

I have some repos which are both in SVN and Git. My username is guyfawkes, and in my home directory I have folder www which contains all my repos. In this directory I also have file update.sh: ...
4
votes
1answer
291 views

How can I git diff markdown (.md) files

I have some markdown files but I can't git diff them. No result at the command line and not supported in gitg (visual git) Is that possible with the files as they are, without converting them to ...
2
votes
2answers
753 views

Sync local files to remote git repository

I have my git repository on a linux located on the company server. I ssh into my linux machine and edit files there. Problem This method is great until I have a good connection to the server. in ...
4
votes
1answer
250 views

What's the fastest (CPU time) way to get my current git branch?

I'm trying to improve the performance of my fish prompt, and since my prompt includes my current git branch, I'm wondering if there may be a way to make it faster. Right now I'm using git ...
0
votes
0answers
537 views

gitweb.cgi: “Premature end of script headers: gitweb.cgi”

I'm running LAMP on Arch and now want the gitweb going on apache. Followed the instructions as in https://wiki.archlinux.org/index.php/Gitweb but on the gitweb directory (here ...
2
votes
1answer
177 views

How can I make git status --short be the default

I can use git status to see a verbose listing (also git status --verbose) and git status --short to see a short listing. How I can I change git status --short be the default instead of the current ...
3
votes
2answers
837 views

Git based package manager/installer for Linux

Is there any linux distro that has a git based package manager/installer. I want something similar to FreeBSD Ports (which is CVS based, I think) or Mac OS X Homebrew (git based).
3
votes
2answers
423 views

how to perform git push using crontab

I'm using crontab for synchronizing git repositories. I was able to do operations like git add and commit, but can't perform git push to origin, since every git push asks for a password. How can I ...
2
votes
1answer
989 views

How do I restart apache as non-root (using a git-hook)?

For one specific user I want to be able to restart Apache. This user does have sudo privileges and I could run sudo /etc/init.d/apache2 reload, but I want to include this restart script in a git ...
3
votes
3answers
2k views

How can I pass output of one command as an argument to another

A similar question has been asked, but since I am new to Unix the answer was not clear to me due to the context. What I want to do is to pass the output of one command as an argument to another. I am ...
5
votes
2answers
2k views

Passing SSH options to git-clone

I connect to my server using SSH: ssh user@server -p 2224 -zZ abcd I also have a git repository on my server. The only way I know to clone is: git clone ssh://user@server.com:2224/path/to/repo ...
7
votes
3answers
35k views

Installing git “sudo: apt-get: command not found”

I am trying to install git. I run the following command: sudo apt-get install git-core git-gui git-doc But receive the following error: sudo: apt-get: command not found What should I do?
5
votes
2answers
9k views

How can I update to a newer version of Git using apt-get?

I've just set up a new machine with Ubuntu Oneiric 11.10 and then run apt-get update apt-get upgrade apt-get install git Now if I run git --version it tells me I have git version 1.7.5.4 but on my ...
4
votes
1answer
962 views

Git-SVN Not Allowing Me to Authenticate

Git 1.7.9.1 on Arch Linux: git svn init -s https://app.svn.beanstalk.com/repo Initialized empty Git repository in /path/to/repo/.git/ Authentication realm: ...
6
votes
1answer
3k views

What is the .gitignore pattern equivalent of the regex (Big|Small)(State|City)-[0-9]*\.csv

I have a regex I stuck in my .gitignore similar to: (Big|Small)(State|City)-[0-9]*\.csv It didn't work so I tested it against RegexLab.NET. I then found the gitignore man page which led me to ...
3
votes
1answer
239 views

How to stage part of hunk with added newline at EOF?

Is there some way to stage individual lines of a file which has just been changed to include newline at EOF? I tried add -p, but it wouldn't split the relevant hunk into small enough parts, and it's ...
5
votes
6answers
1k views

How to sort (by whatever key) BibTex entries in `.bib` file?

I work with LaTeX and do versioning with Git. For bibliography management I use Mendeley. The problem is that each time Mendeley synchronizes it's .bib exports, they are in different order, what ...
3
votes
1answer
875 views

git grep colors differ from grep custom colors

I've setup grep colors in my ~/.bashrc : export GREP_COLORS='ms=01;34:mc=01;34:sl=:cx=:fn=35:ln=32:bn=32:se=36' They work for grep --color=auto grep --color=always Unfortunately, those custom ...
2
votes
1answer
98 views

Revert commits and commit them to a branch?

I'm cloning a popular open source project into GitHub, and I only realized this after it was too late. I'm also trying to convert this project over to use Maven instead of Ant/Ivy for a build tool. I ...
1
vote
0answers
2k views

Git hangs indefinitely when trying to push --all to GitHub

When I try and push --all to GitHub, the Git transfer starts out fast, slows down, and eventually stops. It doesn't fail, it just slows to a halt. What's going on? This is really frustrating, I'd ...
21
votes
9answers
2k views

How to keep track of changes in /etc/

I would like to keep track of changes in /etc/ Basically I'd like to know if a file was changed, by yum update or by a user and roll it back if I don't like the chage. I thought of using a VCS like ...
2
votes
1answer
57 views

GIT push only commits older than x months

Is there a way to specify push commits that are older than x months to remote y ? Like setting up a branch that automatically tracks master-(x months) and then push it to a separate remote?
3
votes
5answers
1k views

Configure permissions

I'm sharing a git repository with a friend over SSH. He pushes from and pulls to his git repository using my machine's SSH server, where the shared git repository is. Problem is that when he pushes a ...
3
votes
1answer
86 views

Hosting Git Repositories as per GitHub [closed]

I'm wondering how exactly GitHub does what they do as far as hosting Git repositories goes. For example, I'm assuming that they manage repository push permissions based on values in some SQL table ...
1
vote
1answer
213 views

route traffic to github through specific network interface [closed]

okey, I'm a complete NAP, so take it easy on me :) My Situation; My computer is in this stupid cooperate network of the company i work for. They have alot of policies and stuff, so its not possible ...
0
votes
4answers
406 views

What is the proper way to automate SSH/local command?

I have gitolite on a Centos 5.5 box - when a repository is updated, I need to send a command to my bug tracking appliance to get the new commands. Right now, I have the following command working: ssh ...
6
votes
1answer
620 views

Multiple installed versions of git - centos

I manually installed git 1.6 a year or two ago. I noticed today that the 1.7 version is available in yum, and installed it (package git-all) I now get the following output: [root@ovz5197 ~]# git ...
5
votes
4answers
141 views

Change command-line “environment” to programs command

In a console, is it possible to change into a commands "environment"? To explain, I take "git" as an example. While programming and using a git repository, I change to the repos path and then do many ...
12
votes
3answers
5k views

Answer yes in a bash script

I'm trying to do a git clone trough a bash script, but the first time that I run the script and the server is not known yet the script fails. I have something like this: yes | git clone ...
4
votes
2answers
2k views

Tar a folder without .git files?

If I tar a folder that is a git repository, can I do so without including the .git related files? If not, how would I go about doing that via a command?
1
vote
1answer
2k views

Permissions issue with git

I have a development machine that use runs on CentOs. Whenever i pull from git using git pull i get "permission denied" issue/error. Git apparently doesn't have the permission to overwrite the ...
5
votes
1answer
2k views

Github adding a repository as a fork from an existing clone

So I have a git repository that I cloned from an upstream source on ghithub. I made a few changes to to it (that are uncommitted and in the master branch). What I want to do is push my changes onto my ...
3
votes
1answer
370 views

Git - remove deleted files

I'm using this simple git alias rmdel = "!git rm $(git ls-files -d)" meant "remove deleted", i.e. to remove from the staging area all files deleted from the file system. It works fine except ...
0
votes
1answer
586 views

github ssh problem- permission denied(publickey)

I tried setting up git as shown in Github's help page, on Arch linux but there seems to be some problem with the SSH keys. It gives this error- Permission denied (publickey). This problem is ...
0
votes
2answers
360 views

Ruby and Git refuse to update. (Mac)

I've been trying to update Git for a while. I'm currently stuck on 1.7.3.4, and I've tried updating to 1.7.4.x, and 1.7.5.x but it never works. Today I compiled and installed Ruby 1.9.2, but it still ...
1
vote
1answer
393 views

Execute a command in a different path

When using Git VCS, I execute all of the git commands on the directory that contains a .git repository. I want to execute a git-pull through an SSH trigger but how do I define the path to the ...
2
votes
2answers
501 views

timeline statistics with git

I would like to generate a statistic from my git repository to create a time-chart: <commit> <timestamp> <changed-lines> 35abf648cfc 2011-04-04t17:23:58 +20 -4 93acb668f32 ...
-1
votes
1answer
140 views

standard VCS ignore list [closed]

What all do you think is the best standard list of ignored files for VCS? For example here's my .gitignore_global file. # Compiled Sources # ################### *.pyc *.pyo *.exe *.so *.o *.a *.la ...
10
votes
7answers
2k views

How do I encrypt git on my server?

Heres the closest I've gotten: I installed gitolite in the /Private folder using ecryptfs-utils (sudo apt-get install ecryptfs-utils adduser git ecryptfs-setup-private then the rest was configuring ...