Questions tagged [git]

Git is a distributed source control system.

Git is a source control system that allows for many people to work on the same project simultaneously. It is distributed, makes it possible for many different branches of the same project to co-exist at the same time, and offers many other advanced features.

Git was originally authored by Linus Torvalds, the creator of the Linux kernel, and the official Git homepage is at git-scm.com

For git quick guide, see gitready.com. More information, see wikipedia

1119 questions
544
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 where it's located). I'm using the standard…
binaryorganic
  • 5,901
  • 4
  • 17
  • 19
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.
  • 3,007
  • 5
  • 20
  • 15
235
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 people to pull to that repository, as well. The…
Andrey Fedorov
  • 2,079
  • 4
  • 16
  • 12
185
votes
6 answers

Non interactive git clone (ssh fingerprint prompt)

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 fingerprint is…
qwe
  • 1,897
  • 2
  • 13
  • 5
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 hour/day etc. to update the changes. The .git…
Smudge
  • 24,039
  • 15
  • 57
  • 76
109
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
  • 1,225
  • 2
  • 8
  • 7
98
votes
11 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 Order deny,allow Deny from all with no success. I know that…
Shoan
  • 1,595
  • 3
  • 16
  • 23
95
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 the files currently present in the repository?
Eric Bréchemier
  • 1,335
  • 1
  • 11
  • 8
78
votes
4 answers

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

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 the address I want. It appears as if setting…
Chas. Owens
  • 2,013
  • 2
  • 20
  • 24
74
votes
10 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
  • 876
  • 1
  • 8
  • 13
64
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 pushed a few revisions (without a git pull on the…
dlrust
  • 685
  • 2
  • 7
  • 12
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:password@host.com/name/.git This works, but my username and my password! are now stored in the origin url in .git/config. How can I prevent this, but still do this in a…
Nathan
  • 733
  • 1
  • 5
  • 7
50
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 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 alreay added EPEL and elrepo but yum still gives…
Oliver
  • 611
  • 1
  • 5
  • 5
33
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 github.com uses port 22. When I try to connect to github it obviously tries to use port 1234. Right now I have to edit my…
James Ward
  • 505
  • 1
  • 4
  • 8
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). I'm currently making use of git to syncronize…
Will Gant
  • 331
  • 1
  • 3
  • 3
1
2 3
74 75