Questions tagged [git]

Git is a distributed source control system.

Filter by
Sorted by
Tagged with
555 votes
32 answers

How do I tell Git for Windows where to find my private RSA key?

My Git setup runs fine on Linux, but when I try to set things up under Windows (using Git for Windows and TortoiseGit), I don't know where to put my private SSH key (or, better still, how to tell ssh ...
binaryorganic's user avatar
243 votes
10 answers

How to tell which local branch is tracking which remote branch in Git?

I would like to know if there's a way to tell which local branch is tracking which remote branch in Git. I'm using one remote server, which is named "origin".
PJ.'s user avatar
  • 3,017
240 votes
10 answers

How do I share a Git repository with multiple users on a machine?

I have a Git repository on a staging server which multiple developers need to be able to pull to. git-init seems to have a flag very close to what I'm looking for: --shared, except I'd like multiple ...
Andrey Fedorov's user avatar
199 votes
6 answers

Non interactive git clone (ssh fingerprint prompt) [duplicate]

I want to clone a repo in a non-interactive way. When cloning, git asks to confirm host's fingerprint: The authenticity of host ' (' can't be established. RSA key ...
qwe's user avatar
  • 2,037
121 votes
16 answers

GIT as a backup tool

On a server, install git cd / git init git add . git commit -a -m "Yes, this is server" Then get /.git/ to point to a network drive (SAN, NFS, Samba whatever) or different disk. Use a cron job every ...
user avatar
119 votes
4 answers

What firewall ports need to be open to allow access to external git repositories?

What firewall port(s) need to be open to allow access to external git repositories?
markdorison's user avatar
  • 1,325
110 votes
12 answers

How do I prevent apache from serving the .git directory?

I have started using git for deployment of websites for testing. How do I prevent apache from serving the .git directory contents? I tried <Directorymatch "^/.*/\.svn/"> Order deny,allow Deny ...
Shoan's user avatar
  • 1,715
102 votes
7 answers

How to retrieve the last modification date of all files in a Git repository

I know how to retrieve the last modification date of a single file in a Git repository: git log -1 --format="%ad" -- path/to/file Is there a simple and efficient way to do the same for all ...
Eric Bréchemier's user avatar
78 votes
4 answers

How do I edit git's history to correct an incorrect email address/name [closed]

When I started using git I just did a git init and started calling add and commit. Now I am starting to pay attention and I can see that my commits are showing up as cowens@localmachine, rather than ...
Chas. Owens's user avatar
  • 2,053
77 votes
11 answers

Where's the conventional place to store git repositories in a linux file system tree?

If I make an analogy with the hosting of a web server, I would say that git's data should be in /var/git, so my git repository would be in /var/git/myrepo Q: Is that the right guess ?
Samuel Rossille's user avatar
66 votes
4 answers

git fetch specific revision from remote repository

We have a remote git repo that we normally deploy from using git push on our dev server then git pull on on our live servers to get the latest pushed version of the repo. But if we have committed and ...
dlrust's user avatar
  • 715
62 votes
11 answers

Install a newer version of Git on CentOS 7

I like to enable Git "Push to Deploy" on my CentOS 7 server. Currently I only can get Git via yum. I need a newer version. Do I have to build it from source or is there any repo I can use? I ...
Oliver's user avatar
  • 731
60 votes
5 answers

How to give username/password to git clone in a script, but not store credentials in .git/config

I am cloning a git repository in a script like this: git clone https://user:[email protected]/name/.git This works, but my username and my password! are now stored in the origin url in .git/config. ...
Nathan's user avatar
  • 733
45 votes
5 answers

Specify SSH Port for Git

I use a non-standard ssh port (1234) for most of the servers I connect to. So in my ssh config file I have: Port 1234 But uses port 22. When I try to connect to github it obviously ...
James Ward's user avatar
32 votes
6 answers

Using rsync from msysgit for binary files

I have three windows boxes that are connected to a linux box on my network in various ways (one's local to the network, one is a laptop and may or may not be local, and the other is my work desktop). ...
Will Gant's user avatar
  • 331
30 votes
5 answers

How to install git to red hat enterprise linux 5.3 x64?

How can I configure yum to use some repository which has git rpms?
BuyManAFish's user avatar
28 votes
2 answers

What are the pros and cons of SSH and HTTP for a git server?

I want to setup a git server. I have found several how-to's, well detailed. Some describe the installation for a git-server accessible thru Ssh, while others, accessible thru HTTP. ( Others even ...
Stephane Rolland's user avatar
27 votes
5 answers

Git shell not enabled?

I'm trying to install git server. When I set default shell for my git user to /usr/bin/git-shell I get an error upon login as git. fatal: Interactive git shell is not enabled. hint: ~/git-shell-...
Peter's user avatar
  • 405
26 votes
7 answers

git clone - fail instead of prompting for credentials

When cloning git repositories in automated tools - web front ends, CI systems, sometimes the git clone invocation opens up a prompt asking for the username and password (for example, when cloning a ...
Tin Tvrtković's user avatar
25 votes
2 answers

How to uninstall git installed from the source? [closed]

I installed the git using this article. Now I want to uninstall the git. How to do it?
Mikhail's user avatar
  • 549
24 votes
4 answers

Enabling nginx Chunked Transfer Encoding

It looks like nginx 0.8.35 may support chunked transfer encoding: Changes with nginx 0.8.35 01 Apr 2010 *) Change: now the charset filter runs before the SSI ...
rentzsch's user avatar
  • 385
23 votes
3 answers

Putting RSA keys into azure key vault

How can I store my key pair (typically the id_rsa and in azure key vault. I want to put the public key in my GIT service and allow a virtual machine to download the private key from Azure ...
MercilessMaverick's user avatar
23 votes
12 answers

Setting Up Git Repository on Remote Windows Server?

I have a windows server which I can access locally or remotely over the internet through remote desktop connection, etc. I want to set up a git repository (something similar to "trunk" in subversion),...
Goober's user avatar
  • 361
22 votes
1 answer

Gitlab backup file location (Omnibus installation)

I have installed Gitlab using omnibus installation package. I took a backup using below command sudo gitlab-rake gitlab:backup:create Backup was successfully created. But I am not sure where to ...
shashwat's user avatar
  • 333
21 votes
6 answers

Putting a whole linux server under source control (git)

I am thinking about putting my whole linux server under version control using git. The reason behind it being that that might be the easiest way to detect malicious modifications/rootkits. All I would ...
Tobias Hertkorn's user avatar
21 votes
2 answers

Use git commands with another path rather than the actual working dir

When using git add . uses the actual path where you're (incase is a git repo). How would I do for using git add, git commit and git push' outside of the working dir? Likegit add /Users/zad0xsis/my-git-...
pmerino's user avatar
  • 471
20 votes
3 answers

Git clone/pull across local network [closed]

I'm trying to clone/pull a repository in another PC using Ubuntu Quantal. I have done this on Windows before but I don't know what is the problem on ubuntu. I tried these: git clone file:////pc-name/...
Tomas Ramirez Sarduy's user avatar
20 votes
5 answers

What does "master" mean in "git push origin master"

I'm new to git as a version control system. I tried reading the documentation, but I don't understand what "master" means in this command: git push origin master Can someone explain in very dumbed-...
John's user avatar
  • 7,363
19 votes
6 answers

Git - post-receive hook with git pull "Failed to find a valid git directory"

It's very weird but when setting a git repository and creating a post-receive hook with: echo "--initializing hook--" cd ~/websites/testing echo "--prepare update--" git pull echo "--update completed-...
zanona's user avatar
  • 345
19 votes
5 answers

Using GIT variables in a declarative Jenkins pipeline

I'm struggling to access GIT variables in my Jenkins pipeline I need to know what GIT branch it's been checked out inside some bash code in a stage of the pipeline. I will use this to create ...
ColOfAbRiX's user avatar
  • 1,080
19 votes
3 answers

How to setup Gitlab with post-receive hook?

I am using Gitlab on one server and would like to push my git repository on commit of the master branch to another webserver. So when I push a new version of the website the production server gets ...
tvb's user avatar
  • 341
18 votes
3 answers

How do I uninstall gitosis?

I've installed gitosis on my dramhost machine but now I want to uninstall it because it's causing more problems than solutions. The thing is that I can't find how to uninstall it. I deleted the ~/...
Oscar Del Ben's user avatar
18 votes
2 answers

Which is better for website backup - rsync or git push

I run 2 LAMP web servers at different providers for disaster recovery purposes - a high powered live server, and a low powered backup server. Currently I rsync all the data from the live server to ...
David Laing's user avatar
17 votes
3 answers

Use git for multiple server configuration files

We have migrated a lot of source code over to git and are very happy with our current solution. We would like to have our server configuration files versioned on the same system, but there are a few ...
Kariem's user avatar
  • 551
16 votes
4 answers

Create SSH user with limited privileges to only use Git repository

I have a git repository hosted on my SunOS server, that I remotely use through ssh git clone ssh://myUs[email protected]/path/to/git Now I need to add more users to be able to access that repository, ...
Bach's user avatar
  • 343
16 votes
5 answers

Git commit auditing

I have a git server running over ssh and each user has a unix account on the system. Given that two users have access to a repo, how can I be sure which user performed which commit, since the commit ...
yannisf's user avatar
  • 577
16 votes
7 answers

Yum doesn't install latest version of Git on Centos6

When I go to Gits download section it mentions that latest version is 1.8 and I can install it by yum install git on Fedora. I'm running CentOS6 so that command should also work for me, but yum tells ...
Reza Sanaie's user avatar
15 votes
3 answers

Setting up a git repo on my GoDaddy hosting plan

I have a project which is version-controlled using git. What I want to be able to do is set up a repo on my (ssh-enabled) GoDaddy shared hosting package so that I can deploy with a push rather than ...
Tom Wright's user avatar
15 votes
2 answers

Using LDAP as auth method for git repositories

I want to convince my boss that we should be using git for version control. He says, that it absolutely must authenticate users through our central LDAP server. I looked at the various solutions (...
Leonard Ehrenfried's user avatar
14 votes
6 answers

Correct user names when tracking /etc/ in git repository and committing as root

We use git to track changes in /etc/ on our servers. Administrators work as root when changing files in /etc/, and thus their commits have author root <root@machinename> This is not very ...
cweiske's user avatar
  • 791
14 votes
2 answers

GIT repository over LAN

I am trying to setup a GIT repository over LAN in Ubuntu OS. I am able to setup a GIT repository, but not sure HOW TO expose the repository to other users in LAN. As it requires a server, I installed ...
user avatar
14 votes
2 answers

What "access rights" could be blocking access to a gitlab repository?

I'm trying to setup gitlab (6.5.1) on a fresh clean server. Everything appears to work, but git is unable to push to any project. Following the commands from the newly created project page and pushing ...
Caleb's user avatar
  • 11.8k
13 votes
2 answers

debian: FATAL -> Failed to fork

First time in my life I have something like this: root@peklan:~# aptitude install git-core No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and ...
holms's user avatar
  • 1,534
13 votes
6 answers

Can etckeeper be used to track config files outside of /etc?

Specifically I would like to track my grub.conf (/boot/grub/grub.conf) and some oracle files (i.e. /db/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora). I attempted using links; however ...
ErebusBat's user avatar
  • 935
13 votes
1 answer

Automatically sign all commits with git [closed]

With git 1.7.9, it's possible to sign a commit with the -S option. Is it possible to set it default through git config --global? So instead of git commit -S -m 'Commit message', it would be just git ...
tamasd's user avatar
  • 233
13 votes
4 answers

Encrypt git repository on server (safe against theft of physical hardware)

I have a production server (Ubuntu, running 24/7) with a git repository and some client computers each with a working copy of this repository. In the client computers, simply using home folder ...
leemes's user avatar
  • 301
13 votes
2 answers

git, nagios and hooks, corrupted git repo

Background We're using nagios to monitor our infrastructure. We don't have the nagios configs under version control at the moment, and there are two of us that manage nagios configuration. As such, I'...
EEAA's user avatar
  • 109k
12 votes
2 answers

How do I make GitLab delete old backups?

I use the rake task to create backups for GitLab 6.8.2. gitlab-rake gitlab:backup:create In /etc/gitlab/gitlab.rb I added the following line: gitlab_rails['backup_keep_time'] = 60 This is supposed ...
Jan Deinhard's user avatar
  • 2,383
12 votes
5 answers

Can't install GIT on a CentOS 6.0 x64

I'm trying to install GIT by either RPM or YUM but i can't. I get the following error: error: Failed dependencies: is needed by git-1.7.1-2.el6.i686 is ...
CodeOverload's user avatar
12 votes
2 answers

Allow User 'git' to run 'git pull' as 'www-data' via sudo

I would like to allow git to run 'git pull' as user 'www-data'. As far as i understand git ALL=(www-data) git pull in /etc/sudoers should make it. Sadly i get an Syntax error for this line and ...
Ben's user avatar
  • 123

2 3 4 5