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

1133 questions
244
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,027
107
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?
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,083
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 pushed a few revisions (without a git pull on the…
dlrust
  • 715
  • 2
  • 8
  • 13
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
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-down terms?
learningtech
  • 7,445
  • 23
  • 64
  • 88
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 OpenSSH-Server. But don’t know HOW TO configure…
user20162
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'm working to get our nagios config into a central…
EEAA
  • 109,904
12
votes
3 answers

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 * (no branch) master Foolishly, I thought I…
interstar
  • 1,321
11
votes
4 answers

How do you move your Git repository from one server to another?

I need to move Git to a new location and was wondering if there's a way to just rsync my git repository to a new location?
user41422
  • 131
10
votes
3 answers

How to delete Git repository with Gitosis

I'm using Gitosis to administer some Git repositories on a remote server. Since I'm at the beginning with it, I make a lot of mistakes. That's why right now I need to delete a Git repository that I created with Gitosis. Is this possible using…
7
votes
1 answer

How do I fix the metainformation on the first commit in git?

This is a related question to How do I edit git’s history to correct an incorrect email address/name. Using git rebase -i , git commit --amend --author "Foo ", and git rebase --continue, I was able to fix the logs for…
Chas. Owens
  • 2,083
6
votes
1 answer

Git clone with user and password

I'm using Git on Windows with LDAP. No issue so far. When I'm cloning my remote repository I call: git clone http://user@host.com/name/.git and I got a prompt for password This is working. But now I will run a script and clone without password…
6
votes
1 answer

git diff between two branches when the path has changed

I need to understand changes to a file between two releases represented by my current master and branch new_branch. Normally, I would run the following if path/name are the same in both branches. git diff new_branch -- path/file What do I do when…
Mike Jr
  • 197
5
votes
2 answers

Git fails to push with error 'out of memory'

I'm using gitosis on a server that has a low amount of memory, specifically around 512 MB. When I try to push a large folder (happens to be a backup from an android phone), I get: me@corellia:~/Configs/$ git push origin master Counting objects: 18,…
jwir3
  • 155
1
2 3 4 5 6 7