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
2023
votes
15 answers

Undo working copy modifications of one file in Git

After the last commit, I modified a bunch of files in my working copy, but I want to undo the changes to one of those files, as in reset it to the same state as the most recent commit. However, I only want to undo the working copy changes of just…
hasen
  • 161,647
  • 65
  • 194
  • 231
1939
votes
32 answers

How can I get a list of Git branches, ordered by most recent commit?

I want to get a list of all the branches in a Git repository with the "freshest" branches at the top, where the "freshest" branch is the one that's been committed to most recently (and is, therefore, more likely to be one I want to pay attention…
Joe White
  • 94,807
  • 60
  • 220
  • 330
1659
votes
5 answers

Warning: push.default is unset; its implicit value is changing in Git 2.0

I've been using Git for a while now and have recently downloaded an update only to find this warning message come up when I try to push. warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To…
Marko
  • 71,361
  • 28
  • 124
  • 158
1615
votes
34 answers

How do I migrate an SVN repository with history to a new Git repository?

I read the Git manual, FAQ, Git - SVN crash course, etc. and they all explain this and that, but nowhere can you find a simple instruction like: SVN repository in: svn://myserver/path/to/svn/repos Git repository in:…
Milan Babuškov
  • 59,775
  • 49
  • 126
  • 179
1602
votes
16 answers

How can I view a git log of just one user's commits?

When using git log, how can I filter by user so that I see only commits from that user?
markdorison
  • 139,374
  • 27
  • 55
  • 71
1585
votes
20 answers

How can I undo git reset --hard HEAD~1?

Is it possible to undo the changes caused by the following command? If so, how? git reset --hard HEAD~1
Paul Wicks
  • 62,960
  • 55
  • 119
  • 146
1434
votes
19 answers

How do I remove a single file from the staging area (undo git add)?

Situation: I have a Git repository with files already in the index. I make changes to several files, open Git and add these files to my staging area with "git add ." Question: How do I remove one of those files from the staging area but not remove…
PHLAK
  • 22,023
  • 18
  • 49
  • 52
1415
votes
18 answers

Undo git pull, how to bring repos to old state

Is there any way to revert or undo git pull so that my source/repos will come to old state that was before doing git pull ? I want to do this because it merged some files which I didn't want to do so, but only merge other remaining files. So, I want…
seg.server.fault
  • 19,118
  • 13
  • 35
  • 31
1275
votes
8 answers

How to tag an older commit in Git?

We are new to git, and I want to set a tag at the beginning of our repository. Our production code is the same as the beginning repository, but we've made commits since then. A tag at the beginning would allow us to "roll back" production to a…
hogsolo
  • 13,565
  • 6
  • 24
  • 25
1272
votes
3 answers

How to list branches that contain a given commit?

How can I query git to find out which branches contain a given commit? gitk will usually list the branches, unless there are too many, in which case it just says "many (38)" or something like that. I need to know the full list, or at least whether…
Andrew Arnott
  • 80,040
  • 26
  • 132
  • 171
1125
votes
18 answers

What's the difference between git reset --mixed, --soft, and --hard?

I'm looking to split a commit up and not sure which reset option to use. I was looking at the page In plain English, what does "git reset" do?, but I realized I don't really understand what the git index or staging area is and thus the explanations…
Michael Chinen
  • 17,737
  • 5
  • 33
  • 45
1062
votes
23 answers

How to remove/delete a large file from commit history in the Git repository?

I accidentally dropped a DVD-rip into a website project, then carelessly git commit -a -m ..., and, zap, the repo was bloated by 2.2 gigs. Next time I made some edits, deleted the video file, and committed everything, but the compressed file is…
culebrón
  • 34,265
  • 20
  • 72
  • 110
1048
votes
6 answers

Definition of "downstream" and "upstream"

I've started playing with Git and have come across the terms "upstream" and "downstream". I've seen these before but never understood them fully. What do these terms mean in the context of SCMs (Software Configuration Management tools) and source…
brendan
  • 11,831
  • 3
  • 26
  • 26
1039
votes
11 answers

Git workflow and rebase vs merge questions

I've been using Git now for a couple of months on a project with one other developer. I have several years of experience with SVN, so I guess I bring a lot of baggage to the relationship. I have heard that Git is excellent for branching and merging,…
Micah
  • 17,584
  • 8
  • 40
  • 46
1032
votes
21 answers

Getting Git to work with a proxy server - fails with "Request timed out"

How do I get Git to use a proxy server? I need to check out code from a Git server, but it shows "Request timed out" every time. How do I get around this? Alternatively, how can I set a proxy server?
Debajit
  • 46,327
  • 33
  • 91
  • 100