Questions tagged [git]

Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is a distributed version control system.

Git was designed to handle everything from small to very large projects with speed and efficiency. It is known for being very powerful but having a somewhat steep learning curve.

Git was originally developed by Linus Torvalds in 2005 for use for the Linux kernel and has spread from there. It is also used as part of the backbone behind popular web-based hosting sites such as Github, Bitbucket and Gitorius.

1006 questions
347
votes
5 answers

How can I update to a newer version of Git using apt-get?

I've just set up a new machine with Ubuntu Oneiric 11.10 and then run apt-get update apt-get upgrade apt-get install git Now if I run git --version it tells me I have git version 1.7.5.4 but on my local machine I have the much newer git version…
cwd
  • 44,479
  • 71
  • 146
  • 167
328
votes
12 answers

How to colorize output of git?

Is there a way to color output for git (or any command)? Consider: baller@Laptop:~/rails/spunky-monkey$ git status # On branch new-message-types # Changes not staged for commit: # (use "git add ..." to update what will be committed) # (use…
B Seven
  • 7,659
  • 7
  • 23
  • 20
208
votes
7 answers

Determine if Git working directory is clean from a script

I have a script which runs rsync with a Git working directory as destination. I want the script to have different behavior depending on if the working directory is clean (no changes to commit), or not. For instance, if the output of git status is as…
brentwpeterson
  • 3,583
  • 5
  • 18
  • 20
175
votes
12 answers

GUI for GIT similar to SourceTree

Is there a similar piece of software to SourceTree, a GUI for git, for Linux? I know about Giggle, git cola, etc. I'm looking for a beautiful, easy to use GUI for git.
Glen Solsberry
  • 2,603
  • 3
  • 18
  • 15
112
votes
7 answers

Creating a user without a password

I'm trying to create a user without password like this: sudo adduser \ --system \ --shell /bin/bash \ --gecos ‘User for managing of git version control’ \ --group \ --disabled-password \ --home /home/git \ git It's created…
Erik
  • 1,687
  • 3
  • 13
  • 11
98
votes
12 answers

git pull from remote but no such ref was fetched?

I have a git mirror on my disk and when I want to update my repo with git pull it gives me error message: Your configuration specifies to merge with the ref '3.5/master' from the remote, but no such ref was fetched. It also gives me: …
Micromega
  • 4,201
  • 5
  • 27
  • 34
97
votes
3 answers

Git submodule shows new commits, submodule status says nothing to commit

In a git repository, I have set up my .gitmodules file to reference a github repository: [submodule "src/repo"] path = src/repo url = repourl when I 'git status' on this repo, it shows: On branch master Your branch is up-to-date with…
Catherine Holloway
  • 1,075
  • 1
  • 7
  • 7
78
votes
8 answers

Tips for putting ~ under source control

I want to put my home directory (~) under source control (git, in this case), as I have many setting files (.gitconfig, .gitignore, .emacs, etc.) in there I would like to carry across machines, and having them in Git would make it nice for…
Dan McClain
  • 883
  • 7
  • 7
68
votes
2 answers

How to use rsync to backup a directory without git subdirectory

I want to copy my c directory with all subdirectories excluding ./git subdirectory. I do it using rsync : echo "copy c and sh files " rsync -a --include='*.c' --include='*.sh' --include='*/' --exclude='*' ~/c/ ~/Dropbox/Public/c # remove .git…
Adam
  • 969
  • 1
  • 7
  • 15
55
votes
8 answers

Is it possible to clone only part of a git project?

I found a collection of slackbuilds, some i need there are on GitHub. https://github.com/PhantomX/slackbuilds/ I don't want to get all git. git clone https://github.com/PhantomX/slackbuilds.git But only get a slackbuild, for this one. How to do…
elbarna
  • 12,050
  • 22
  • 92
  • 170
53
votes
3 answers

git diff displays colors incorrectly

In order to get coloured output from all git commands, I set the following: git config --global color.ui true However, this produces an output like this for git diff, git log whereas commands like git status display fine Why is it not recognizing…
user32465
53
votes
5 answers

Storing username and password in Git

When I do git push I get the command prompt like Username for 'https://github.com': then I enter my username manually like Username for 'https://github.com': myusername and then I hit Enter and I get prompt for my password Password for…
GypsyCosmonaut
  • 3,988
  • 7
  • 38
  • 62
53
votes
4 answers

How did `git pull` eat my homework?

I feel like a kid in the principal's office explaining that the dog ate my homework the night before it was due, but I'm staring some crazy data loss bug in the face and I can't figure out how it happened. I would like to know how git could eat my…
Caleb
  • 69,278
  • 18
  • 196
  • 226
52
votes
2 answers

File permission with six bytes in git. What does it mean?

I performed a git commit command and it gave me the following reply: 7 files changed, 93 insertions(+), 15 deletions(-) mode change 100644 => 100755 assets/internal/fonts/icomoon.svg mode change 100644 => 100755…
That Brazilian Guy
  • 4,383
  • 9
  • 25
  • 35
46
votes
5 answers

Tar a folder without .git files?

If I tar a folder that is a git repository, can I do so without including the .git related files? If not, how would I go about doing that via a command?
chrisjlee
  • 8,283
  • 16
  • 49
  • 54
1
2 3
67 68