Skip to main content
The 2024 Developer Survey results are live! See the results

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
26532 votes
108 answers
14.6m views

How do I undo the most recent local commits in Git?

I accidentally committed the wrong files to Git, but didn't push the commit to the server yet. How do I undo those commits from the local repository?
20374 votes
41 answers
11.7m views

How do I delete a Git branch locally and remotely?

Failed Attempts to Delete a Remote Branch: $ git branch -d remotes/origin/bugfix error: branch 'remotes/origin/bugfix' not found. $ git branch -d origin/bugfix error: branch 'origin/bugfix' not found....
13860 votes
37 answers
3.5m views

What is the difference between 'git pull' and 'git fetch'?

What are the differences between git pull and git fetch?
Pablo Fernandez's user avatar
11692 votes
41 answers
5.6m views

How can I rename a local Git branch?

How can I rename a local branch which has not yet been pushed to a remote repository? Related: Rename master branch for both local and remote Git repositories How do I rename both a Git local and ...
Forrest's user avatar
  • 126k
9728 votes
54 answers
8.7m views

How do I force "git pull" to overwrite local files?

How do I force an overwrite of local files on a git pull? My local repository contains a file of the same filename as on the server. error: Untracked working tree file 'example.txt' would be ...
Jakub Troszok's user avatar
6320 votes
40 answers
4.2m views

How do I discard unstaged changes in Git?

How do I discard changes in my working copy that are not in the index?
readonly's user avatar
  • 351k
5767 votes
37 answers
3.1m views

How can I reset or revert a file to a specific revision?

How can I revert a modified file to its previous revision at a specific commit hash (which I determined via git log and git diff)?
Hates_'s user avatar
  • 68.1k
3211 votes
14 answers
2.6m views

I ran into a merge conflict. How do I abort the merge?

I used git pull and had a merge conflict: unmerged: some_file.txt You are in the middle of a conflicted merge. How do I abandon my changes to the file and keep only the pulled changes?
Gwyn Morfey's user avatar
  • 33.3k
3094 votes
43 answers
1.2m views

How do I change the author and committer name/email for multiple commits?

How do I change the author for a range of commits?
Flávio Amieiro's user avatar
2848 votes
21 answers
939k views

Ignore files that have already been committed to a Git repository [duplicate]

I have an already initialized Git repository that I added a .gitignore file to. How can I refresh the file index so the files I want ignored get ignored?
trobrock's user avatar
  • 47k
2687 votes
51 answers
986k views

How do I delete all Git branches which have been merged?

How do I delete branches which have already been merged? Can I delete them all at once, instead of deleting each branch one-by-one?
Nyambaa's user avatar
  • 40.8k
2484 votes
15 answers
1.1m views

Do I commit the package-lock.json file created by npm 5?

npm 5 was released today and one of the new features include deterministic installs with the creation of a package-lock.json file. Is this file supposed to be kept in source control? I'm assuming it'...
rink.attendant.6's user avatar
2418 votes
19 answers
992k views

When do you use Git rebase instead of Git merge?

When is it recommended to use Git rebase vs. Git merge? Do I still need to merge after a successful rebase?
Coocoo4Cocoa's user avatar
2330 votes
26 answers
1.9m views

How can I see the changes in a Git commit?

When I do git diff COMMIT I see the changes between that commit and HEAD (as far as I know), but I would like to see the changes that were made by that single commit. I haven't found any obvious ...
laktak's user avatar
  • 59.1k
2109 votes
4 answers
684k views

How does Git handle symbolic links?

If I have a file or directory that is a symbolic link and I commit it to a Git repository, what happens to it? I would assume that it leaves it as a symbolic link until the file is deleted and then ...
Alex's user avatar
  • 36k

15 30 50 per page
1
2 3 4 5
1150