Questions tagged [git]
Git is an open-source DVCS (Distributed Version Control System)
1,156
questions
417
votes
8
answers
481k
views
What does 'stage' mean in git?
I find git hard to understand as I could not find the meaning of the words used for the actions. I have checked the dictionary for the meaning of 'stage' and none of the meanings were related to ...
308
votes
16
answers
45k
views
Why does everyone use Git in a centralized manner?
I have used Git at my past two companies for version control. It seems from what I've heard that about 90% of companies use Git over other version control systems.
One of the biggest selling points ...
307
votes
10
answers
42k
views
I'm a Subversion geek, why should I consider or not consider Mercurial or Git or any other DVCS?
I try to understand the benefits of distributed version control system (DVCS).
I found Subversion Re-education and this article by Martin Fowler very useful.
Mercurial and others DVCS promote a ...
301
votes
20
answers
113k
views
What does SVN do better than Git? [closed]
No question that the majority of debates over programmer tools distill to either personal choice (by the user) or design emphasis, that is, optimizing design according to particular uses cases (by the ...
299
votes
6
answers
82k
views
Why squash git commits for pull requests?
Why does every serious Github repo I do pull requests for want me to squash my commits into a single commit?
I thought the git log was there so you could inspect all your history and see exactly what ...
282
votes
6
answers
164k
views
Choosing between Single or multiple projects in a git repository?
In a git environment, where we have modularized most projects, we're facing the one project per repository or multiple projects per repository design issue. Let's consider a modularized project:
...
268
votes
10
answers
143k
views
Should images be stored in a git repository?
For a distributed team that uses Git and GitHub as version control, should images also be stored in the git repository?
The images in question are small/medium-sized web-friendly images. For the most ...
233
votes
15
answers
45k
views
New developer can't keep up with branch merges
I am the new developer - this is my first programming position.
My issue is this: We use git - I cut a branch from our develop branch, then I start working on the minor task I've been assigned. It's ...
203
votes
9
answers
53k
views
Why is Mercurial considered to be easier than Git?
When looking at comparisons, it seems to me that there could be a 1:1 mapping between their feature sets. Yet, an often cited statement is that "Mercurial is easier". What is the basis of this ...
186
votes
2
answers
218k
views
Git branching and tagging best practices
I am currently learning to use Git by reading Pro Git. Right now I'm learning about branching and tags. My question is when should I use a branch and when should I use a tag?
For example, say I ...
183
votes
4
answers
50k
views
What is the benefit of git's two-stage commit process (staging)?
I'm learning git and I've noticed that it has a two-step commit process:
git add <files>
git commit
The first step places revisions into what's called a "staging area" or "index".
What I'm ...
151
votes
1
answer
15k
views
What are the advantages and disadvantages of cryptographically signing commits and tags in Git?
So someone peer reviewed my work, and he told me that I should always sign my commits and tags cryptographically. When asked why, he didn't know to explain it to me, and said "It's just a good thing ...
149
votes
9
answers
23k
views
Maintain hundreds of customized branches over master branch
Currently we have one master branch for our PHP application in a shared repository. We have more than 500 clients who are subscribers of our software, most of whom have some customization for ...
148
votes
7
answers
66k
views
Working on a branch with a dependence on another branch that is being reviewed
How does git help deal with the scenario below:
I have a task broken down into 2 parts: backend task and frontend task. I make a pull request to merge the backend changes and wait for it to be merged ...
146
votes
6
answers
142k
views
How do you achieve a numeric versioning scheme with Git?
My organization is considering moving from SVN to Git. One argument against moving is as follows:
How do we do versioning?
We have an SDK distribution based on the NetBeans Platform. As the SVN ...
141
votes
6
answers
82k
views
The trend of the "develop" branch going away
I've noticed something lately looking at some popular projects on GitHub, that there's no develop branch. And in fact, the GitHub Flow guide doesn't mention it either. From my understanding, master ...
129
votes
23
answers
32k
views
Why did Git get so much hype? ...while others don't? [closed]
In the recent years, the hype around Git raised greatly. Everybody knows about Git, nobody knows about alternatives.
Other ones like Mercurial seem to be unnoticed. Both have been released in 2005, ...
127
votes
11
answers
21k
views
How can I minimize git pain when everybody is working on master?
Our documentation team of about ten people recently moved from SVN to Git. In SVN, everybody worked on master -- a model I've always hated, but I wasn't able to bring about that change. As part of ...
120
votes
7
answers
20k
views
My office wants infinite branch merges as policy; what other options do we have?
My office is trying to figure out how we handle branch splits and merges, and we've run into a big problem.
Our issue is with long-term sidebranches -- the kind where you've got a few people working ...
116
votes
10
answers
19k
views
My coworker commits and pushes without testing
When my coworker thinks that there is no need for a test on his PC, he makes changes, commits and then pushes. Then he tests on the production server and realizes that he made a mistake. It happens ...
112
votes
14
answers
19k
views
How can I maintain code quality without SCM?
I am working in a governmental institution. The technology being used here and the methods for developing software are quite old fashioned.
They have tons of storage space but no appropriate space ...
111
votes
1
answer
24k
views
If I fork a project on Github that is licensed under MIT, how do I handle the attribution and copyright notice?
If I plan to fork an MIT project and significantly modify and rename it, how do I handle the copyright notice above the MIT license on the main License file. Would I list the original author and my ...
93
votes
11
answers
29k
views
git for personal (one-man) projects. Overkill?
I know, and use, two version control systems: Subversion and git. Subversion, as of now, gets used for personal projects where I am the only developer and git gets used for open source projects and ...
93
votes
8
answers
167k
views
Using multiple Git repositories instead of a single one containing many apps from different teams? [duplicate]
I am migrating a 10-years-old big CVS repository to Git. It seemed obvious to split this multiple-projects repository into several Git ones. But the decision-makers are used to CVS, therefore their ...
90
votes
11
answers
44k
views
Why learn git when there are GUI apps for GitHub?
Given that GitHub provides GUI apps for both Mac and Windows, what are the benefits of learning to use git from the command line?
Currently I'm using their mac app to update my repositories, and so ...
89
votes
10
answers
20k
views
Why is the sudden increase in number of Git submitters on Debian popcon graph in 2010-01?
Almost every article I've read 1 comparing Git and Mercurial it seems like Mercurial has a better command line UX with each command being limited to one idea only (unlike say git checkout).
But at ...
85
votes
6
answers
17k
views
Why does git use hashes instead of revision numbers?
I always wondered why git prefers hashes over revision numbers. Revision numbers are much clearer and easier to refer to (in my opinion): There is a difference between telling someone to take a look ...
83
votes
9
answers
74k
views
Should Git be used for documentation and project management? Should the code be in a separate repository?
I'm starting up a Git repository for a group project. Does it make sense to store documents in the same Git repository as code - it seems like this conflicts with the nature of the git revision flow.
...
83
votes
4
answers
45k
views
Should we include the NuGet PACKAGE folder in version control?
In a C# or VB.NET project, should we include the PACKAGE folder (NuGet package folder that is created in the root of my project that contains the nupkg files and other content) to our source control ...
81
votes
7
answers
21k
views
Why do so many projects prefer "git rebase" over "git merge"?
One of the advantages of using a DVCS is the edit-commit-merge workflow (over edit-merge-commit often enforced by a CVCS). Allowing each unique change to be recorded in the repository independent of ...
81
votes
5
answers
14k
views
Why does git pull perform a merge instead of a rebase by default?
Consider the following situation:
You have a clone of a git repository
You have some local commits (commits that have not yet been pushed anywhere)
The remote repository has new commits that you have ...
79
votes
8
answers
31k
views
Is it a good practice to use branches to maintain different editions of the same software?
We have a product that has a few different editions. The differences are minor: different strings here and there, very little additional logic in one, very little difference in logic in the other. ...
78
votes
4
answers
66k
views
Are there any statistics that show the popularity of Git versus SVN? [closed]
I'm writing an essay, and would like to have some empiric evidence, perhaps longitudinal data where the popularity of these technologies is compared over a period of some years.
Are there any ...
72
votes
17
answers
16k
views
What can I do for developers who can't learn Git? [closed]
Context
My team of 8 engineers is currently transitioning to Git (from Subversion) for our next big thing. We have a handful of 'more experienced' engineers that are finding it quite difficult to ...
71
votes
2
answers
67k
views
Summarize changes (insertions and deletions) in Git [closed]
I want to look at how my code base has grown over time. GitHub has a nice +/- display along the list of checkins which gives a sense of this. Is there something similar I can use with my Google Code ...
71
votes
3
answers
37k
views
Can a git commit have more than 2 parents?
In this documentation it is mentioned
A commit object may have any number of parents.
But from my understanding, the only case where a commit will have more than 1 parent is when a merge has ...
69
votes
8
answers
15k
views
In code review, should I ask to do a refactor outside of the scope in a pull request?
I have been studying the best practices for a code review, and I was wondering what to do in the following scenario:
During a code review, I see potential improvements, but decide that they are ...
68
votes
1
answer
28k
views
Gerrit code review, or Github's fork and pull model?
I am starting a software project that will be team AND community developed. I was previously sold on gerrit, but now Github's fork and pull request model seem to almost provide more tools, ways to ...
67
votes
5
answers
36k
views
As a sole developer (for now), how should I be using Git?
I have multiple projects on Git that I eventually want to bring others into. However, right now it's just me and I use Git and GitHub very simplistically: no branches and basically just using the ...
65
votes
5
answers
36k
views
Is backing up a MySQL database in Git a good idea?
I am trying to improve the backup situation for my application. I have a Django application and MySQL database. I read an article suggesting backing up the database in Git.
On the one hand I like it,...
64
votes
2
answers
18k
views
Are Git branches, in fact, "homeomorphic endofunctors mapping submanifolds of a Hilbert space"?
As we all know:
Git gets easier once you understand branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space
Which seems like jargon, but on the other hand,
All told, a ...
62
votes
11
answers
9k
views
Should a git commit message mention the file that was modified?
In the first line of a git commit message I have a habit of mentioning the file that modified if a change doesn't span multiple files, for example:
Add [somefunc] to [somefile]
Is this a good thing ...
62
votes
4
answers
53k
views
Appropriate Git workflow for multiple active releases while handling hotfixes
I'm trying to choose a Git workflow that is most appropriate for our product. Here are the parameters:
We do a few major releases a year, let's say 10 at the most
We have multiple versions of our ...
61
votes
3
answers
50k
views
Reusing a merged branch, good practice?
Currently, I used to create a new branch each time I have to add a new feature to my application.
When my feature is finished and functional, I merge it with the master branch.
But later, when I ...
60
votes
8
answers
13k
views
Should generated documentation be stored in a Git repository?
When you use tools like jsdocs, it generates static HTML files and its styles in your codebase based on the comments in your code.
Should these files be checked into the Git repository or should they ...
59
votes
8
answers
11k
views
Do seasoned developers still have to deal with merge conflicts?
I am still a software engineer in training, but I have heard the following adage multiple times:
Good coders don't have to deal with merge conflicts.
Whenever I work on a project with others, I'm ...
59
votes
4
answers
9k
views
What happens if a feature merged into develop is postponed by management?
We recently had a problem whereby a feature for our webapp (automatic signup) was postponed by management because they felt the start was too "cold" but they wanted all the other features we had been ...
58
votes
3
answers
9k
views
If GitHub interacts with Git, and Git is licensed under GPLv2, shouldn't GitHub be open source?
Since Git is licensed under GPLv2, and, to my understanding, GitHub interacts with Git, shouldn't the whole GitHub codebase be open-sourced in a GPL-compatible license?
52
votes
8
answers
12k
views
Should every git commit leave the project in a working state?
I'm curious to know what the prevailing best practice is. Should git commits be enforced such that the project is in a working state (builds properly, all tests pass etc), or is committing broken code ...
52
votes
5
answers
14k
views
Organizing Git repositories with common nested sub-modules
I'm a big fan of Git sub-modules. I like to be able to track a dependency along with its version, so that you can roll-back to a previous version of your project and have the corresponding version of ...