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.

Filter by
Sorted by
Tagged with
868
votes
20answers
320k views

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 ...
23516
votes
100answers
10.2m 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 can I undo those commits from the local repository? The only way seems to be to copy the edits in ...
2667
votes
21answers
791k 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?
18650
votes
41answers
9.4m views

How do I delete a Git branch locally and remotely?

I want to delete a branch both 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 ...
2659
votes
39answers
961k views

How to change the author and committer name and e-mail of multiple commits in Git?

I was writing a simple script on the school computer, and committing the changes to Git (in a repo that was in my pen drive, cloned from my computer at home). After several commits, I realized I was ...
854
votes
37answers
727k views

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 ...
983
votes
6answers
322k views

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 (...
12902
votes
38answers
3.1m views

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

What are the differences between git pull and git fetch?
8341
votes
47answers
6.2m views

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

How do I force an overwrite of local files on a git pull? The scenario is the following: A team member is modifying the templates for a website we are working on They are adding some images to the ...
5116
votes
34answers
2.4m views

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

I have made some changes to a file which has been committed a few times as part of a group of files, but now want to reset/revert the changes on it back to a previous version. I have done a git log ...
1841
votes
17answers
550k 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?
1375
votes
19answers
584k views

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
191
votes
8answers
176k views

Why do I need to explicitly push a new branch?

I am new in git and I am practicing. I created a local branch but I saw that when I did git push my branch was not uploaded to the repository. I had to actually do: git push -u origin --all. Why is ...
1191
votes
3answers
339k views

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 ...
171
votes
8answers
52k views

Which commit has this blob?

Given the hash of a blob, is there a way to get a list of commits that have this blob in their tree?
583
votes
34answers
312k views

Multiple GitHub accounts on the same computer?

Trying to work on both my actual "work" repos, and my repos on git hub, from my computer. The work account was set up first, and everything works flawlessly. My account, however, cannot seem ...
1558
votes
34answers
499k views

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 ...
916
votes
22answers
299k views

Git ignore file for Xcode projects

Which files should I include in .gitignore when using Git in conjunction with Xcode?
8
votes
3answers
3k views

What is the right way to maintain a "version for the server" - with only config files changed, in Git?

I sometimes work with Codeigniter, and after I'm done developing on the local site, I need to migrate the files to the server. All the files in the /config/ folder need to be changed to match the ...
1016
votes
11answers
215k views

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 ...
186
votes
17answers
385k views

Updates were rejected because the remote contains work that you do not have locally

I'm working on a team with a few developers using git on BitBucket. We are all working on a dev branch, not pushing to master until a release. One of the developers committed incorrect code that ...
1829
votes
4answers
488k 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 ...
974
votes
20answers
1.1m views

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 ...
935
votes
17answers
278k views

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 ...
111
votes
12answers
37k views

When should you branch?

When working with a SCM system, when should you branch?
84
votes
10answers
11k views

Committing Machine Specific Configuration Files

A common scenario when I develop is that the codebase will have several config files which require machine specific settings. These files will be checked into Git and other developers will always ...
533
votes
12answers
196k views

Managing large binary files with Git

I am looking for opinions of how to handle large binary files on which my source code (web application) is dependent. We are currently discussing several alternatives: Copy the binary files by hand. ...
816
votes
22answers
272k views

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?
5491
votes
37answers
3.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?
647
votes
17answers
240k views

How to convert a normal Git repository to a bare one?

How can I convert a 'normal' Git repository to a bare one? The main difference seems to be: in the normal Git repository, you have a .git folder inside the repository containing all relevant data ...
75
votes
5answers
57k views

Recovering added/staged file after doing git reset --hard HEAD^?

I added a new file F1 and made changes to another file F2 but then did a git reset --hard HEAD^ and I have lost all the changes to the files. Is there some way, I can get them back? I did look at a ...
47
votes
10answers
74k views

How can I use ClearCase to "add to source control ..." recursively?

I unpacked a zip-file delivery into a clearcase view. Now I want to add the complete file tree to the repository. The GUI only provides an "Add to source control ..." for individual files/directories. ...
9925
votes
36answers
3.8m views

How do I rename a local Git branch?

I don't want to rename a remote branch, as described in Rename master branch for both local and remote Git repositories. How can I rename a local branch which hasn't been pushed to a remote repository?...
2267
votes
48answers
708k views

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

I have many Git branches. How do I delete branches which have already been merged? Is there an easy way to delete them all instead of deleting them one by one?
168
votes
20answers
70k views

How do you use version control with Access development?

I'm involved with updating an Access solution. It has a good amount of VBA, a number of queries, a small amount of tables, and a few forms for data entry & report generation. It's an ideal ...
52
votes
9answers
8k views

Distributed Version Control Systems and the Enterprise - a Good mix? [closed]

I can see why distributed source control systems (DVCS - like Mercurial) make sense for open source projects. But do they make sense for an enterprise? (over a centralized Source Control System such ...
381
votes
25answers
228k views

Can I automatically increment the file build version when using Visual Studio?

I was just wondering how I could automatically increment the build (and version?) of my files using Visual Studio (2005). If I look up the properties of say C:\Windows\notepad.exe, the Version tab ...
216
votes
4answers
75k views

Why is a 3-way merge advantageous over a 2-way merge?

Wikipedia says a 3-way merge is less error-prone than a 2-way merge, and often times doesn't need user intervention. Why is this the case? An example where a 3-way merge succeeds and a 2-way merge ...
84
votes
9answers
115k views

Unable to Git-push master to Github - 'origin' does not appear to be a git repository / permission denied

This question is related to my problem in understanding rebase, branch and merge, and to the problem How can you commit to your github account as you have a teamMate in your remote list? I found ...
157
votes
8answers
239k views

What does "Git push non-fast-forward updates were rejected" mean?

I'm using Git to manage my two computers and my development. I'm trying to commit changes to GitHub, and I got this error: Failed to push some refs to <repo>. To prevent you from losing history,...
557
votes
5answers
167k views

What's the difference between HEAD, working tree and index, in Git?

Can someone tell me the difference between HEAD, working tree and index, in Git? From what I understand, they are all names for different branches. Is my assumption correct? Edit I found this A ...
774
votes
23answers
593k views

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 ...
212
votes
6answers
144k views

What is a tracking branch?

Can someone explain a "tracking branch" as it applies to git? Here's the definition from git-scm.com: A 'tracking branch' in Git is a local branch that is connected to a remote branch. When ...
806
votes
18answers
1.1m views

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 ...
426
votes
27answers
273k views

Git: "Corrupt loose object"

Whenever I pull from my remote, I get the following error about compression. When I run the manual compression, I get the same: $ git gc error: Could not read 3813783126d41a3200b35b6681357c213352ab31 ...
1222
votes
15answers
1.2m views

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, ...
261
votes
15answers
60k views

Insert a commit before the root commit in Git?

I've asked before about how to squash the first two commits in a git repository. While the solutions are rather interesting and not really as mind-warping as some other things in git, they're still a ...
74
votes
3answers
36k views

What is this Git warning message when pushing changes to a remote repository?

The description is a bit terse. I simply added a file on my local master branch and pushed it back to a remote repo. Any idea why this is coming up? warning: updating the current branch warning: ...
17
votes
2answers
3k views

Git cherry pick and datamodel integrity

Given that two branches have diverged and a specific commit from one branch (and not everything) needs to be introduced to the other, git cherry pick achieves exactly that. After some time there is ...
245
votes
8answers
56k views

Which Eclipse files belong under version control?

Which Eclipse files is it appropriate to put under source control, aside from the sources obviously? In my project, specifically, I'm wondering about: .metadata/* project-dir/.project project-...

1
2 3 4 5
47