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

26
votes
4answers
32k 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 ...
2
votes
2answers
336 views

Get last commit message, author and hash using git ls-remote like command

I'm looking for a way to get three informations from a remote repository using git ls-remote like command. I would like to use it in a bash script running in a cron. Currently, if I do git ls-remote ...
1
vote
1answer
19 views

How to push a new branch to remote git with commit message

I am new to git. my remote git server does not allow me to push anything without having a commit message. Now i want to convert my perforce code to git using git p4 and push the converted code as a ...
2
votes
2answers
3k views

Git pull error libcurl.so.3 not found

I have a php script to git pull from my github repository set up in my webservice hook urls like so: <?php echo shell_exec('~/git/usr/bin/git pull 2>&1'); ?> When I open this script ...
8
votes
2answers
5k 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 ...
1
vote
1answer
64 views

How to un-commit a file in git?

I have did git commit <file> for a file and also submitted that file with git submit <file>. but now i want to un-commit the changes. i have also tried git reset HEAD~1 <file> ...
0
votes
1answer
42 views

Elegant Way To Store Dotfiles on GitHub

I need an elegant solution to store my dotfiles on GitHub for easy access. I tried to create a dotfiles directory and symlink all the dotfiles into there. Then I tried adding the symlinks to git and ...
2
votes
2answers
53 views

Git config forwarding

I don't know if this even possible or not. I was wondering if there is any way like SSH Agent forwarding by which we can forward our .gitconfig on the remote server, and git automatically picks the ...
2
votes
1answer
766 views

SSH Agent Forwarding on server

I'm struggling with the concept of SSH Agent Forwarding. This is what I've done so far: Create default identity local (ssh-keygen) Install the public key on bitbucket Now I want to connect to a ...
6
votes
0answers
2k views

git-upload-pack hangs indefinitely

I have the following call structure: Jenkins runs fab -Huser@host set_repository_commit_hash:123abc. set_repository_commit_hash runs git fetch with pty = False. The child process ssh git@github.com ...
4
votes
2answers
1k 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 ...
20
votes
5answers
6k views

How can I create an alias for a git [action] command (which includes spaces)?

Most of my my aliases are of this form: alias p='pwd' I want to alias git commit so that it does git commit -v But trying to create an alias with a space gives an error: $ alias 'git commit'='git ...
0
votes
1answer
85 views

Why can't I use ssh?

The problem seems to occur straight from the time I have installed Ubuntu 14.04 LTS. I first realized this problem when I was trying to connect with my hosting at HostGator. I neglected and thought ...
4
votes
2answers
111 views

How do I find a tag that contains a commit?

I have the SHA ID of a commit that I am interested in and would like to know how to find the first tag that contains it.
1
vote
2answers
206 views

What's the difference between `Commit hash`, `Parent Hash` and `Tree hash` in git?

Today I'm learning some basic git knowledge via reading this doc online: http://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-Hi And at that chapter, I'm start to learn using git log ...
2
votes
2answers
221 views

diff --git unknown option

when I try to run diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c I get unknown option (I have installed git via apt-get install git)
5
votes
1answer
2k views

How to create a git repo using Nginx?

I've a CentOS 5 server at domain.fr. I am trying to set a subdomain so that I can use it with git : git.domain.fr My repositories are in /home/git (example /home/git/repos.git) I've installed ...
0
votes
1answer
26 views

how to pipe output from git commands into unix diff utility?

I am trying to achieve something along the lines of diff -ywB --suppress-common-lines `git branch --merged prod-server` `git branch --merged test-server` so that I can know the difference of what ...
1
vote
0answers
17 views

Display only relevant hunks of a diff/patch based on a regexp

git log -G<regex> -p is a wonderful tool to search a codebase's history for changes that match the specified pattern. However, it can be overwhelming to locate the relevant hunk in the ...
1
vote
1answer
33 views

How to download a sub directory on git.gnome.org?

I want to tweak the Adwaita gtk3 theme a bit, and I found it here. There are two many files to download, and I had no luck using neither git clone ...
0
votes
0answers
25 views

enforcing php version based on git branch

Is there a way similar to .rvmrc to automatically set the php version used while developing in a branch? I think phpbrew will do what we want, however we are uncertain how to enforce a specified ...
2
votes
1answer
42 views

Git submodule shows new commits, submodule status says nothing to commit

In a git repository, I have set up my .gitmodules file to reference a github repository: [submodule "src/repo"] path = src/repo url = repourl when I 'git status' on this repo, it shows: On ...
7
votes
2answers
3k views

What does “--” mean in Linux/Unix command line? [duplicate]

Possible Duplicate: What does “--” (double-dash) mean? git diff [options] [<commit>] [--] [<path>…] In here, how should I understand what [--] means? And when should I use it.
0
votes
0answers
11 views

gitg - no blame mode in 3.14

Since the new version of gitg has changed dramatically, I cannot seem to find some things I use to use such as blame mode. Did it disappear in 3.14.1-r1 or newer?
8
votes
7answers
2k 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 ...
0
votes
1answer
73 views

ssh asking for passphrase that doesn't have passphrase

I'm trying to build docker image with this docker file and I need to clone some private repositories from bitbucket. FROM ubuntu RUN chsh -s /bin/bash RUN apt-get update RUN apt-get install -y ...
1
vote
1answer
33 views

howto use ~/.ssh/config with Windows/PuTTY

howto use ~/.ssh/config with Windows/PuTTY? Are PuTTY settings stored in registry? I wish to have my PuTTY settings in git. So it needs to be a human readable text file.
8
votes
2answers
84k 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?
0
votes
1answer
56 views

A bash script that can automate git commit message contents

Normally when I commit a change to a submodule in Git (and if that's the only change), I will provide the result of git diff <submodule-name> to the body of the commit message (with ...
0
votes
2answers
17 views

can I set up openssh-server on local machine without messing my git ssh access to git and gerrit server?

We have git/ gerrit ssh on local machine (~/.ssh/id_rsa id_rsa.pub known_hosts + ssh-agent ) Now we want to access local machine from multiple remote clients (4-5 users, 1 user at a time), to ...
5
votes
3answers
5k views

Installing Git, Curl, and Expat from Source

I have a RHEL 6.4 VM provisioned by my companies internal KVM. We are having some trouble using yum (Cannot retrieve repository metadata, which Ive confirmed in this case is peculiar to my company's ...
1
vote
1answer
31 views

ssh-agent and timeout

I am using a script to update my system: cd /opt/ chmod 600 /opt/updater/.ssh/.pk ssh-agent bash -c 'ssh-add /opt/updater/.ssh/.pk; git stash; git pull origin master' /opt/updater/bin/updater.sh My ...
1
vote
2answers
41 views

Show git branches that diverged from remote?

Which command lists all the local branches that diverged from the remote branches they follow (either because the local branch has new commits or the remote one)?
46
votes
4answers
59k views

GUI for GIT similar to SourceTree

Is there a similar piece of software to SourceTree, a GUI for git, for Linux? I know about Giggle, git cola, etc. I'm looking for a beautiful, easy to use GUI for git.
0
votes
0answers
27 views

git refuses to connect without proxy

I work on a Linux system in a Windows environment. To authenticate with a NT proxy server I had setup cntlm and configured system programs to use it via setting http_proxy environment variable in the ...
28
votes
8answers
5k 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 ...
1
vote
0answers
87 views

Fetch patches from mailing list with mutt and vim

How can I fetch patches from a subscribed development mailinglist with mutt and vim so that they can be applied with "git am" or "git apply" command easily? Is it either possible to save it ...
1
vote
1answer
51 views

Non-deterministic errors when using nested sshfs

The OSX implementation of sshfs doesn't like to connect to my Android phone running SSHDroid, so I'm attempting to gain access by mounting an ubuntu VM via sshfs which in turn has a mountpoint to the ...
2
votes
2answers
41 views

What optimized tools are available for comparing directory contents?

I am mirroring a Subversion repository tag with svn2git and I want to be sure that when I checkout particular revisions, those I obtain from the git mirror match those from Subversion. My main problem ...
5
votes
2answers
1k views

command line method or programtically add ssh key to github.com user account

Is there a way to identify with a username and password to github.com servers for the purpose of adding an ssh key to the github user account? So far everything I've read suggests that a users ssh key ...
5
votes
1answer
3k views

How to recover broken/partially deleted git repository

I accidently ran an rm -r on my .git directory. Luckly rm stopped when it got to a write-protected file, but I've still lost several things in my .git. Files I still have: FETCH_HEAD ORIG_HEAD ...
2
votes
1answer
48 views

Can you fetch git commit data using cURL?

I need to fetch the object of an annotated tag (i.e. the annotation message) from a remote repository and so far there doesn't seem to be a command for that (i.e. ls-remote provides only the refs but ...
0
votes
0answers
53 views

git add . error on dedicated server; fatal: Not a git repository

I was able to initialize a git repo on a directory containing one of our websites, but when I try to git add . I get this error: fatal: Not a git repository: ...
3
votes
1answer
33 views

How to view entire commit when log is filtered by file in tig

If tig is invoked with tig log some/file.txt the log will show all commits affecting that file. Pressing Enter on a line like commit d5dd1d658e5d79701fb9d028479a0fcb26a033fa will open the diff view ...
0
votes
0answers
84 views

Run Git Pull from a shell start-up script

I have raspberry-pi that loads a shell script on start up. This script runs a python script 'boot_camera.py' which is found in a repository. I Have a server which sends the raspberry-pi a command ...
0
votes
0answers
12 views

Hacking caja on mint

I'm trying to add a couple of changes to caja on Mint (MATE edition) and I'm trying to test them out, manually. Doing autogen.sh && make && sudo make install on the upstream version ...
0
votes
2answers
40 views

Git clone from Bitbucket

I am trying to git clone a repo off of bitbucket. I use git clone {https} temp. This gives me an error of refs not found. The https address is the one I get off of bitbucket, but the one they provide ...
1
vote
1answer
113 views

zsh git command auto-complete add extra origin to the git branch name

After I clone a git repository locally, I want to switch branch to, says, 'ABCD'. $ git branch -a * master remotes/origin/ABCD remotes/origin/HEAD -> origin/master remotes/origin/master $ ...
3
votes
1answer
45 views

What is git revert --quit for?

From the git-revert(1) manpage it is not clear to me what the exact differences between the quit and abort options of the revert command are. From my exercises with the revert command I made the ...
0
votes
1answer
134 views

git Fatal: Out of memory, malloc failed on branch push

I know this has been asked a lot but I did not manage to get any solution to solve my problem. My coworker assigned me on a new project. The application is hosted on test Debian server with git ...