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

41
votes
3answers
960 views

How did `git pull` eat my homework?

I feel like a kid in the principal's office explaining that the dog ate my homework the night before it was due, but I'm staring some crazy data loss bug in the face and I can't figure out how it ...
1
vote
2answers
27 views

Install Git offline without sudo

I have a corporate Linux server which does not have internet connection, and sudo access needs to be approved through many levels of hierachy. I've tried install git but I soon realized this needs a ...
2
votes
1answer
816 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 ...
1
vote
1answer
11 views

How download complete patch series from patchwork?

I want to download the patch series RFC PATCH 00/26 i.MX5/6 IPUv3 CSI/IC In patchwork I can get access to individual patches https://patchwork.linuxtv.org/patch/24331/. But downloading 26 patches and ...
0
votes
1answer
16 views

Need Info on linux command ssh-keygen -t rsa -b 4096 -C “your_email@example.com”

I have to access personal git repository at the university . I have been asked to Generate SSH key. I am using this command to generate an SSH key: ssh-keygen -t rsa -b 4096 -C ...
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 ...
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 ...
2
votes
1answer
451 views

sudo -u git clone

I'm on Ubuntu server 14.04. I am using apache web server which runs as the www-data. I need to do git clone from a script (a web hook). This script will run with www-data user privilages. Running ...
29
votes
4answers
34k 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
464 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
26 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
66 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
56 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
58 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 ...
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 ...
5
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
105 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
112 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
247 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
235 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)
0
votes
1answer
35 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
20 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
35 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
59 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
20 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?
0
votes
1answer
106 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
41 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
87k 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
72 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
19 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
34 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
42 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)?
48
votes
4answers
63k 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
39 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
100 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
63 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
44 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
2k 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
53 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
61 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
34 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
117 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 ...