Questions tagged [git]

Git is an open-source DVCS (Distributed Version Control System)

Filter by
Sorted by
Tagged with
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: ...
Johan Sjöberg's user avatar
24 votes
6 answers
4k views

git / other VCS - how often to commit? [duplicate]

I've been a programmer now for over 11 years, and am just starting to get into version control for real. The places I've worked at have never really used version control (one committed at the end of ...
clinton3141's user avatar
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 ...
user avatar
68 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 ...
VirtuosiMedia's user avatar
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 ...
Fernando Tan's user avatar
  • 1,527
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. ...
Tamás Szelei's user avatar
50 votes
10 answers
21k views

Is it ever OK to commit non-working code?

Is it good idea to require to commit only working code? This commit doesn't need to leave the repository in a working state as: ... we are in early design stages, the code is not yet stable. ... ...
Vorac's user avatar
  • 7,093
187 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 ...
Code-Guru's user avatar
  • 2,449
13 votes
2 answers
16k views

How to make a "git push" update files on your web host?

I have a few sites which are all hosted on the same web hosting service under shared hosting. My web host supports Git and I have SSH access to it, and I also have Git setup on my laptop as well. I ...
Ryan's user avatar
  • 1,261
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 ...
Anto's user avatar
  • 11.2k
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 ...
298 votes
6 answers
83k 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 ...
hamstar's user avatar
  • 3,091
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 ...
spong's user avatar
  • 9,381
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 ...
40 votes
2 answers
26k views

Where should QA team do the testing in Gitflow branching model

We are a big team (10-12 developers and 4 qa) working on multiple projects with the same git repository. Its a spring boot based backend web service. We are looking for a good git branching and deploy ...
srini's user avatar
  • 653
36 votes
3 answers
27k views

When to separate a project in multiple subprojects

I'd like to know if it makes sense to divide the project I'm working on in two repositories instead of one. From what I can say: Frontend will be written in html+js Backend in .net The backend ...
Loïc Faure-Lacroix's user avatar
28 votes
4 answers
2k views

When should the VCS history of a project be deleted? [duplicate]

I just refactored my project's entire codebase. So much so that even though it uses most of the same code base, things work in a radically different way. If the old version was 1.0, the new one would ...
Pris's user avatar
  • 385
2 votes
1 answer
2k views

Git Repository Structure for Interdependent Projects

Note: I've seen several other questions about repository organization, but I haven't found any with this dependency issue Current Structure At the moment, we have several distributions (which must ...
Nick's user avatar
  • 131
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 ...
thomasrutter's user avatar
  • 2,311
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 ...
Erlend's user avatar
  • 1,563
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. ...
EmpireJones's user avatar
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 ...
Suan's user avatar
  • 621
28 votes
6 answers
3k views

Is version history really sacred or is it better to rebase?

I've always agreed with Mercurial's mantra 1, however, now that Mercurial comes bundled with the rebase extension and it is a popular practice in git, I'm wondering if it could really be regarded as a ...
dukeofgaming's user avatar
  • 13.9k
19 votes
3 answers
18k views

Whats the work flow with 2 people on a project

I come to you as a newbie programmer who's been working on his own project (which is progressing nicely). My co-founder has also been learning how to program and has reached a point where he could ...
Geoff Wright's user avatar
7 votes
3 answers
1k views

What should be the workflow with a git repository?

I work on several git repositories though on most not more than 2 people work. Mostly me and my boss. Very often when we work in parallel it happens that "git log" doesn't look so nice because of the ...
Joe's user avatar
  • 73
5 votes
1 answer
3k views

What is a good frequency for merging up feature branches to a main line?

We have a very large code base in mercurial. We have about a 6 month release cadence with 2 week sprints. For each release we have about 10 feature branches and maybe 5 or so people working per ...
marathon's user avatar
  • 161
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 ...
garbage collection's user avatar
47 votes
4 answers
23k views

code review with git-flow and github

With regular git and github I can do a code review by simply creating a pull request of the feature branch I'm working on to the master branch. How would I do code reviews with git-flow? With workflow ...
AdamT's user avatar
  • 579
40 votes
8 answers
12k views

Can you recommend a good commit message template / guidelines to enforce in the company? [closed]

In Git it's possible to set and enforce a good commit template. Can you recommend (preferably with argumentation) a good commit template / guidelines to enforce in the company?
kyrisu's user avatar
  • 666
39 votes
1 answer
11k views

Pulling in changes from a forked repo without a request on GitHub?

I'm new to the social coding community and don't know how to proceed properly in this situation: I've created a GitHub Repository a couple weeks ago. Someone forked the project and has made some ...
Alec's user avatar
  • 493
34 votes
12 answers
2k views

Do DVCSes discourage continuous integration?

Say there is a team of ten agile developers. Every day they each pick a task from the board, commits several changes against it, until (by the end of the day) they have completed the task. All ...
Richard Dingwall's user avatar
28 votes
6 answers
8k views

What does "branching is free" mean in Git?

What does "branching is free" mean in Git? I hear this a lot whenever Git is mentioned in comparison to other version control systems. I haven't had the opportunity (?) to deal with others (SVN, etc....
laggingreflex's user avatar
26 votes
4 answers
10k views

How to commit in-progress refactoring?

So, I have this big project, which is in the process of being refactored by me. I am changing a lot of stuff, so there is no chance to get it to compile some time soon. I am living in a special git ...
bitmask's user avatar
  • 879
23 votes
3 answers
12k views

Git branching strategy for long-running unreleased code

At our team, in addition to individual units of work (Stories), we have longer-running themes of work (Epics). Multiple stories make an epic. Traditionally we've had feature branches for each Story, ...
Sitati's user avatar
  • 341
21 votes
4 answers
8k views

github team workflow - to fork or not?

We're a small team of web developers currently using subversion but soon we're making a switch to github. I'm looking at different types of github workflows, and we're not sure if the whole forking ...
aporat's user avatar
  • 311
17 votes
5 answers
2k views

What version control system can manage all aspects? [closed]

A few months ago I dug into Subversion and GIT and was disappointed. They handle SOURCE CODE fine but not other aspects. For example, a web site under version control needs to manage file/directory ...
Andy Canfield's user avatar
16 votes
2 answers
1k views

Where to push a failing test?

I just changed branch settings on my GitHub repository, so that my [next] branch requires a passing CI build through a pull request. A discussion followed with a number of team members, about failing ...
Mathieu Guindon's user avatar
15 votes
2 answers
2k views

How to open-source a project whose git repository has copyrighted media in the history?

I want to release an audio fingerprinting software project under a free license, but the repository contains copyrighted audio files. The test cases also currently use these files. How do I release ...
Tim has moved to Codidact's user avatar
12 votes
7 answers
9k views

What is the best way to record in git which commit is currently deployed to which environment?

We run a deployment pipeline where we build a versioned binary, tag the commit it was built from with the same version as the binary, and then can deploy the binary into arbitrary environments (...
Robert Elliot's user avatar
12 votes
1 answer
13k views

GitHub Organizations for a project spanning multiple repositories?

I've started a project that involves at least three repositories on GitHub. One of the repositories is a generic documentation-and-examples dump, and the other two contain the implementation of two ...
jcora's user avatar
  • 1,461
12 votes
2 answers
6k views

Managing multiple versions of a web application using Git

We have a family of apps, all having the same base. Until now I've been developing this base, and the Git workflow was very simple: Development is done in develop branch New features are developed in ...
João Daniel's user avatar
11 votes
2 answers
3k views

What is the netiquette for forking other people's open source projects? [duplicate]

I started to get more and more engaged in open source development and I was wondering if there are any guidelines on how to properly document and maintain a fork? For example, let's say you fork a ...
Toni Petrina's user avatar
11 votes
2 answers
3k views

Git for a solo developer [duplicate]

I'm a developer working on a Wordpress project. I work on this alone and I want to improve the way I use Git but I don't know where to start. Currently, I'm using git to commit all of the work that I'...
Wern Ancheta's user avatar
7 votes
3 answers
6k views

version control security

We are looking for a version control tool. I personally think it's pretty cool to use Git. However, my boss recommends TFS. He told me it's much more secure to use an SQL Sever based tool, such as TFS ...
LYQ's user avatar
  • 71
6 votes
3 answers
5k views

Team switching from TFS Source Control to TFS with Git, not sure how to handle complex project structure

I've used git for my personal projects for years, but that's always working alone, not needing to branch much, etc. Our development team at work has decided we are definitely switching to git, and as ...
James P. Wright's user avatar
6 votes
3 answers
936 views

Is it a good practice to split one commit into two, where one is content change, the other is style(indent) change?

Suppose I am to make a commit that wrapped a section of code inside another thing, so the section came to have 1 more level of indent. In diff it will show delete 100 lines, add 100 lines though all ...
golopot's user avatar
  • 246
4 votes
2 answers
1k views

How do I merge branches between Develop - Test and Production without moving across 'test' specific code?

I have a web application that has some specific differences between production and test environments. I.e. test email config, test payment config, the word Test written on the home page (useful to be ...
Noel Andrews's user avatar
1 vote
1 answer
537 views

Git commit messages with nvie branching model

This Git branching model recommends branching for all development efforts and merging when complete: Branch Develop Merge when complete I'm wondering how this works in practice, given that ...
eykanal's user avatar
  • 1,644
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 ...
Madara's Ghost's user avatar
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 ...
ffxsam's user avatar
  • 1,551