Questions tagged [version-control]

Version control is the management of changes to documents, programs, and other information stored as computer files. Use this tag to mark general questions about usage and applicability of version control, VCS comparison. For most commands and techniques specific to each particular VCS there are specific tags, which should be preferred.

Version control, also known as revision control, source control or software configuration management (SCM), is the management of changes to documents, programs, and other information stored as computer files. It is most commonly used in software development, where a team of people may change the same files.

For questions specific to a certain version control software use the appropriate tag. Here is an (incomplete) list of commonly used tags:

17112 questions
1030
votes
19 answers

How can I stop .gitignore from appearing in the list of untracked files?

I just did a git init on the root of my new project. Then I created a .gitignore file. Now, when I type git status, .gitignore file appears in the list of untracked files. Why is that?
Jacques René Mesrine
  • 46,127
  • 27
  • 66
  • 104
975
votes
4 answers

Undo a particular commit in Git that's been pushed to remote repos

What is the simplest way to undo a particular commit that is: not in the head or HEAD Has been pushed to the remote. Because if it is not the latest commit, git reset HEAD doesn't work. And because it has been pushed to a remote, git rebase…
lprsd
  • 84,407
  • 47
  • 135
  • 168
966
votes
14 answers

Get changes from master into branch in Git

In my repository I have a branch called aq which I'm working on. I then committed new work and bugs in master. What is the best way to get those commits into the aq branch? Create another new branch out of master and merge it with aq?
Slee
  • 27,498
  • 52
  • 145
  • 243
957
votes
21 answers

Git ignore file for Xcode projects

Which files should I include in .gitignore when using Git in conjunction with Xcode?
Hagelin
  • 16,440
  • 5
  • 29
  • 37
955
votes
23 answers

Is there a way to get the git root directory in one command?

Mercurial has a way of printing the root directory (that contains .hg) via hg root Is there something equivalent in git to get the directory that contains the .git directory?
wojo
  • 11,061
  • 4
  • 22
  • 21
935
votes
19 answers

How can I make git accept a self signed certificate?

Using Git, is there a way to tell it to accept a self signed certificate? I am using an https server to host a git server but for now the certificate is self signed. When I try to create the repo there for the first time: git push origin master…
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
904
votes
22 answers

Should I add the Visual Studio .suo and .user files to source control?

Visual Studio solutions contain two types of hidden user files. One is the solution .suo file which is a binary file. The other is the project .user file which is a text file. Exactly what data do these files contain? I've also been wondering…
Ben Mills
  • 27,454
  • 14
  • 42
  • 38
900
votes
40 answers

Download single files from GitHub

What are some tips on downloading a single file from a GitHub repo? I don't want the URL for displaying the raw file; in the case of binaries, there's nothing. http://support.github.com/discussions/feature-requests/41-download-single-file Is it even…
Radek Simko
  • 15,886
  • 17
  • 69
  • 107
864
votes
23 answers

Git: How to squash all commits on branch

I make new branch from master with: git checkout -b testbranch I make 20 commits into it. Now I want to squash those 20 commits. I do that with: git rebase -i HEAD~20 What about if I don't know how many commits? Is there any way to do something…
user3803850
  • 8,797
  • 3
  • 12
  • 6
854
votes
37 answers

Git for beginners: The definitive practical guide

Ok, after seeing this post by PJ Hyett, I have decided to skip to the end and go with Git. So what I need is a beginner's practical guide to Git. "Beginner" being defined as someone who knows how to handle their compiler, understands to some level…
Adam Davis
  • 91,931
  • 60
  • 264
  • 330
850
votes
5 answers

View a file in a different Git branch without changing branches

Is it possible to open a file in a git branch without checking out that branch? How? Essentially I want to be able to open a file in my github pages branch without switching branches all the time. I don't want to modify it, just want to view it.
Schneems
  • 14,918
  • 9
  • 57
  • 84
789
votes
22 answers

How do I ignore a directory with SVN?

I just started using SVN, and I have a cache directory that I don't need under source control. How can I ignore the whole directory/folder with SVN? I am using Versions and TextMate on OS X and commandline.
Gilean
  • 14,708
  • 10
  • 45
  • 52
757
votes
14 answers

Set up git to pull and push all branches

I'd like to push and pull all the branches by default, including the newly created ones. Is there a setting that I can define for it? Otherwise, when I add a new branch, locally and I want to pull it from the server, what is the simplest way to do…
lprsd
  • 84,407
  • 47
  • 135
  • 168
752
votes
40 answers

Multiple GitHub accounts on the same computer?

Trying to work on both my actual "work" repos, and my repos on GitHub, from my computer. The work account was set up first, and everything works flawlessly. My account, however, cannot seem to push to my repo, which is set up under a different…
Kevin Whitaker
  • 12,435
  • 12
  • 51
  • 89
726
votes
25 answers

What is the Difference Between Mercurial and Git?

I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences…
Spoike
  • 119,724
  • 44
  • 140
  • 158