Questions tagged [git]
Git is a distributed source control system.
1,138
questions
560
votes
33
answers
1.2m
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 ...
245
votes
10
answers
167k
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".
241
votes
10
answers
308k
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 ...
205
votes
6
answers
196k
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 ...
122
votes
17
answers
82k
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 ...
119
votes
4
answers
221k
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?
113
votes
12
answers
85k
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 ...
108
votes
7
answers
85k
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 ...
78
votes
4
answers
49k
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 ...
78
votes
11
answers
64k
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 ?
68
votes
13
answers
134k
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 ...
66
votes
4
answers
245k
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 ...
61
votes
6
answers
306k
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:[email protected]/name/.git
This works, but my username and my password! are now stored in the origin url in .git/config.
...
47
votes
5
answers
135k
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 ...
32
votes
6
answers
31k
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). ...
30
votes
5
answers
59k
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?
28
votes
7
answers
43k
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 ...
28
votes
2
answers
24k
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 ...
27
votes
5
answers
49k
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-...
25
votes
4
answers
56k
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 ...
25
votes
2
answers
22k
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?
24
votes
3
answers
38k
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 ...
24
votes
2
answers
19k
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-...
23
votes
12
answers
36k
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),...
22
votes
1
answer
19k
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 ...
21
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 ...
20
votes
3
answers
63k
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/...
20
votes
5
answers
72k
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-...
19
votes
6
answers
15k
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-...
19
votes
5
answers
80k
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 ...
19
votes
3
answers
43k
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 ...
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 ~/...
18
votes
2
answers
10k
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 ...
17
votes
5
answers
4k
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 ...
17
votes
3
answers
15k
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 ...
16
votes
4
answers
26k
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://[email protected]/path/to/git
Now I need to add more users to be able to access that repository, ...
16
votes
7
answers
30k
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 ...
15
votes
6
answers
7k
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 ...
15
votes
3
answers
15k
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 ...
15
votes
1
answer
9k
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 ...
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 (...
14
votes
2
answers
7k
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 ...
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 ...
13
votes
2
answers
22k
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 ...
13
votes
3
answers
18k
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
*...
13
votes
2
answers
14k
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 ...
13
votes
8
answers
89k
views
Gitlab not working with SSH Keys
I am having issues with Gitlab. I used the following guide to install and configure Gitlab https://github.com/gitlabhq/gitlab-recipes/blob/master/install/centos/README.md. The installation seemed to ...
13
votes
6
answers
4k
views
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 ...
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 ...
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'...