Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [git]

Git is a distributed source control system.

Filter by
Sorted by
Tagged with
536 votes
32 answers
1.1m views

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 ...
user avatar
243 votes
10 answers
158k views

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".
user avatar
  • 2,997
233 votes
10 answers
285k views

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 ...
user avatar
180 votes
6 answers
154k views

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 'bitbucket.org (207.223.240.182)' can't be established. RSA key ...
user avatar
  • 1,847
119 votes
16 answers
74k views

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
  • 23.9k
109 votes
4 answers
187k views

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?
user avatar
  • 1,225
97 votes
11 answers
68k views

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 ...
user avatar
  • 1,585
90 votes
7 answers
68k views

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 ...
user avatar
78 votes
4 answers
48k views

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 ...
user avatar
  • 2,003
73 votes
10 answers
51k views

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 ?
user avatar
64 votes
4 answers
238k views

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 ...
user avatar
  • 685
59 votes
5 answers
296k views

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:password@host.com/name/.git This works, but my username and my password! are now stored in the origin url in .git/config. ...
user avatar
  • 723
46 votes
11 answers
86k views

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 1.8.3.1 via yum. I need a newer version. Do I have to build it from source or is there any repo I can use? I ...
user avatar
  • 571
32 votes
6 answers
27k views

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). ...
user avatar
  • 331
31 votes
5 answers
93k views

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 github.com uses port 22. When I try to connect to github it obviously ...
user avatar
30 votes
5 answers
58k views

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?
user avatar
28 votes
2 answers
23k views

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 ...
user avatar
25 votes
5 answers
44k views

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-...
user avatar
  • 385
24 votes
2 answers
20k views

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?
user avatar
  • 539
23 votes
1 answer
17k views

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 ...
user avatar
  • 343
23 votes
7 answers
28k views

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 ...
user avatar
22 votes
3 answers
26k views

Putting RSA keys into azure key vault

How can I store my key pair (typically the id_rsa and id_rsa.pub) 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 ...
user avatar
22 votes
13 answers
34k views

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),...
user avatar
  • 351
21 votes
4 answers
42k views

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 ...
user avatar
  • 355
20 votes
3 answers
54k views

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/...
user avatar
20 votes
6 answers
5k views

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 ...
user avatar
19 votes
5 answers
68k views

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-...
user avatar
  • 7,033
19 votes
3 answers
42k views

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 ...
user avatar
  • 341
18 votes
6 answers
14k views

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-...
user avatar
  • 335
18 votes
3 answers
8k views

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 ~/...
user avatar
18 votes
2 answers
9k views

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 ...
user avatar
17 votes
3 answers
14k views

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 ...
user avatar
  • 491
16 votes
5 answers
3k views

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 ...
user avatar
  • 577
16 votes
7 answers
28k views

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 ...
user avatar
15 votes
4 answers
24k views

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://myUser@mydomain.com/path/to/git Now I need to add more users to be able to access that repository, ...
user avatar
  • 333
15 votes
3 answers
14k views

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 ...
user avatar
15 votes
2 answers
17k views

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 (...
user avatar
14 votes
6 answers
6k views

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 ...
user avatar
  • 781
14 votes
2 answers
6k views

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
39k views

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 ...
user avatar
  • 11.5k
13 votes
5 answers
56k views

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 ...
user avatar
13 votes
2 answers
13k views

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 ...
user avatar
  • 1,444
13 votes
2 answers
8k views

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-...
user avatar
  • 391
13 votes
1 answer
7k views

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 ...
user avatar
  • 233
13 votes
4 answers
5k views

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 ...
user avatar
  • 301
13 votes
2 answers
1k views

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'...
user avatar
  • 108k
12 votes
2 answers
19k views

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 ...
user avatar
  • 2,353
12 votes
5 answers
14k views

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: libcrypto.so.10 is needed by git-1.7.1-2.el6.i686 libcurl.so.4 is ...
user avatar
12 votes
2 answers
33k views

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 ...
user avatar
  • 123
12 votes
3 answers
16k views

Git : seemed to be in "(no branch)" and then lost my changes

I was trying to push from my Git workspace up to Github but my added and committed changes didn't seem to get uploaded. Then, doing a "git branch" I got something that looked like this : git branch *...
user avatar
  • 1,211

1
2 3 4 5
23