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.

1030 questions
104
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…
99
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,211
57
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…
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,695
37
votes
3 answers

How to remove a file from the git index

How do I remove a file from a git repositorie's index without removing the file from the working tree? If I had a file ./notes.txt that was being tracked by git, I could run git rm notes.txt. But that would remove the file. I'd rather want git just…
Stefan
  • 25,300
35
votes
2 answers

Why is less being run unnecessarily by git?

When I run git branch (from bash or csh), it automagically pipes the output through less. However, with only a few branches in the repository this is beyond unnecessary, it is annoying, as the branch listing disappears once I quit less. Checking…
GreenMatt
  • 725
30
votes
2 answers

How to find the first tag that contains a git commit?

I have the SHA ID of a commit that I am interested in and would like to know how to find the first tag that contains it.
merryman
  • 301
28
votes
4 answers

Why can I checkout a branch that was removed on GitHub?

In our GitHub repository, a coworker removed a branch named release. But when I run git checkout release locally, I always get the removed branch release. Same, even when I checked out another branch, deleted the release branch with git branch -D…
Tim
  • 101,790
25
votes
1 answer

How to set multiple `core.excludesfile` in `.gitconfig`?

I'm syncing ~/.gitconfig and ~/.gitignore files in ubuntu and Mac by using dropbox and created symlink for it. And excludesfile is declared like this. [core] editor = /usr/bin/vim excludesfile = /Users/username/.gitignore The…
ironsand
  • 5,205
24
votes
3 answers

What's the difference between `Commit hash`, `Parent Hash` and `Tree hash` in git?

Today I'm learning some basic git knowledge via reading this doc online: http://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-Hi And at that chapter, I'm start to learn using git log --pretty=format:" " to show log info at my taste. But some…
Zen
  • 7,537
15
votes
7 answers

Pipe filelist into 'git add'

I performed a fresh clone and copied/pasted a working directory into the cloned directory. Now have a list of changed files: $ git status --short | grep -v "??" | cut -d " " -f 3 GNUmakefile Readme.txt base32.h base64.h ... When I try to get Git…
user56041
13
votes
1 answer

Does git contain information about used id / group id changes?

I have googling awhile, but can not find such information. Looks like git doesn't contain users and groups, only permissions. Am I right?
strand
  • 133
12
votes
2 answers

Git: edit previous commits' messages only

For lazy reasons I pushed a bunch of commits with default messages and now it has become cumbersome, as I don't really know what I've changed in each commit. How do I edit just the messages of previous commits and (if possible) keep the commit tree?
Tuyen Pham
  • 1,805
12
votes
2 answers

How to replay Git repository history into subdirectory?

Let's say I've got two repositories aye and bee and I want to get rid of bee, in such a way that the linear history of bee/master is "replayed" in a new subdirectory (several levels deep) of aye. I just want the files and the commit messages, I…
l0b0
  • 51,350
11
votes
2 answers

Does git pull after init remove untracked files?

I just made a simple script and created a new repository for it on GitHub. After initializing the local repo, moving the script to the repository and pulling the GitHub repository (containing only a README.md file), the script was gone. Is this…
l0b0
  • 51,350
1
2 3
8 9