Vincent Driessen
nvie.com · Personal blog · on HN since 2010
Vincent Driessen writes about Git workflows, Python tooling and Vim, and is best known for the 'git-flow' branching model post.
What HN saysHN cites his branching model post as a reference for team Git use, though some commenters call it basic, and others link the original when copies appear.
118HN people shared it
83linked it in comments
42stories submitted
1.4Kstory points
9 months agolast shared
2010people per year2026
Most-shared posts
- 1A note of reflection after 10 years of “A successful Git branching model”87 people · 629 points · first shared 2010 · 120 comments on HN
- 2Better Package Management for python7 people · 23 points · first shared 2013 · 25 comments on HN
- 3A Successful Git Branching Model6 people · 14 points · first shared 2010 · discussion on HN
- 4How I boosted my Vim3 people · 164 points · first shared 2010 · 65 comments on HN
- 5Pin Your Packages3 people · 4 points · first shared 2012 · 2 comments on HN
- 6Introducing RQ: Simple job queues for Python3 people · 4 points · first shared 2012 · discussion on HN
- 7A successful Git branching model2 people · 268 points · first shared 2010 · 44 comments on HN
- 815 years later, Microsoft morged my diagram2 people · 94 points · first shared 2026 · 21 comments on HN
- 9Beautiful Map2 people · 1 points · first shared 2015 · discussion on HN
- 10Introducing Times (for Python)1 people · 128 points · first shared 2012 · 18 comments on HN
- 11Survey: Python vs Ruby Test Ecosystems1 people · 33 points · first shared 2010 · 15 comments on HN
- 12Open Sourcing: the Ultimate Isolation1 people · 8 points · first shared 2012 · discussion on HN
- 13Vim-flake8: Flake8 for Vim1 people · 5 points · first shared 2013 · 1 comments on HN
- 14How to Use Git the Right Way1 people · 5 points · first shared 2011 · discussion on HN
- 15Iterables vs. Iterators vs. Generators(2014)1 people · 3 points · first shared 2016 · discussion on HN
What HN people wrote when they linked it
hsn915 · 2021-12-23
It's simply impossible to have reliable "best practices" in programming. It's still a young field and most of the ideas floating around are just fads. Yesterday's best practice will quickly become an anti-pattern tomorrow when another person comes along and creates a pretty looking website to promote his best practice.
None of it is based on actual collective experience. Just the opinions of people who are good at marketing their ideas.
Somehow if something is nicely written up and put up on a good looking website, everyone starts treating it like a well accepted best practice.
Examples that come to mind:
https://www.conventionalcommits.org/
https://nvie.com/posts/a-successful-git-branching-model/
https://semver.org/
postpawl · 2021-06-27
I’d recommend using pip-tools. It doesn’t require any special tooling to install requirements. However, pip-tools will allow you to specify only your top level dependencies in separate files, and it will compile those into requirements.txt files with all dependencies (including sub-dependencies) locked.
More details: https://nvie.com/posts/better-package-management/
I’ve heard a lot of recommendations for poetry too.
edrobap · 2020-12-26
Branching is more of an art. With the kind of flexibility git provides, one can get lost in the convention to follow. I have found this useful For a small team working on app development -
https://nvie.com/posts/a-successful-git-branching-model/
barumi · 2020-11-10
> Seems pretty standard to me. Anything notable here?
I agree, it's pretty vanilla git usage. I was curious to see any insightful take of whimsical twist, but it boils down to a basic take of good old git flow, which is git 101 for a long time.
https://nvie.com/posts/a-successful-git-branching-model/
The only surprising thing in the article was the refusal to use git stash, which can't really be explained on a rational level.
opsroller · 2017-12-28
Fucking plagiarism at its best, here’s the original http://nvie.com/posts/a-successful-git-branching-model/
datr · 2016-03-01
I'd be interested in hearing people's thoughts on deploying feature branches to production before merging them. I've generally followed more of a git-flow approach [1]. This seems to have the advantage that multiple feature branches can be grouped and deployed together - thus, avoiding the problem in the article of the deploy queue becoming a bottle neck.
[1] http://nvie.com/posts/a-successful-git-branching-model/#creating-a-rel…
jonafato · 2016-01-27
This is a good start, but it has issues. You probably don't want all of your locally installed packages in a requirements.txt file. Instead, they should be curated. I've been using pip-compile [0] for a while now (see the author's blog post [1] for a detailed explanation) and have become a big fan of it. With this model, you should enumerate only what your application uses directly and let pip-compile convert this list to a full version-locked requirements.txt. (Shameless plug: I also wrote a bit about why this is the best currently available option for specifying Python dependencies [2].)
[0] https://github.com/nvie/pip-tools#example-usage-for-pip-compile
[1] http://nvie.com/posts/better-package-management/
[2] https://www.jonafato.com/2015/12/15/Rethinking-requirements-txt
tedmiston · 2015-11-05
Pinning precise versions is the best practice for requirements.txt (as opposed to setup.py in a package) (http://nvie.com/posts/pin-your-packages/). Since we have no guarantee that every dependency uses e.g., semantic version, it's the safest way to have reproducible builds across machines.
You can also now list outdated packages with pip if you wanted to upgrade them yourself or test compatibility of new versions. Example for a side project I have laying around:
$ pip list --outdated
Django (Current: 1.8.5 Latest: 1.8.6)
$ pip install --upgrade django
...
nvie81 · 2015-06-15
I've written a follow-up blog post here, hopefully providing another perspective:
http://nvie.com/posts/beautiful-map/
willsentance · 2015-01-23
I always recommend this: http://nvie.com/posts/a-successful-git-branching-model/
Not exactly a 'how it works' article, more how it can work really well
gatehouse · 2014-10-25
One big thing that helped me get started was following this workflow: http://nvie.com/posts/a-successful-git-branching-model/
If you have co-workers whose workflow you can copy then I don't think it is needed, but if you want to start a project from scratch with Git then having a plan like this can be really helpful.
phn · 2014-10-20
If you're on a feature branch, you can probably commit often, and push often (effectively backing up your work), then, the isolated unit of work is done on a single commit (non-FF) when merging with the main branch (this is the one you search for when you want to revert something or find the culprit for something).
This allows having "best of both worlds", I think.
EDIT: Take a look at the feature branches on the git flow model: http://nvie.com/posts/a-successful-git-branching-model/
yuribit · 2014-05-27
After learning Git, it is important to follow a branching model, I really appreciate the one proposed here http://nvie.com/posts/a-successful-git-branching-model
smd4 · 2014-03-23
The best resources I've found for understanding git workflows are by Vincent Driessen[1] and Atlassian[2].
The Atlassian page is much more comprehensive, and in fact derives the 'GitFlow' workflow from Driessen. However, I prefer his original top-to-bottom representation (a left-to-right time axis seems less intuitive to me - they remind me of a football playbook rather than a waterfall).
[1] http://nvie.com/posts/a-successful-git-branching-model/
[2] https://www.atlassian.com/git/workflows
upops · 2014-03-13
On the Trello Android team we have a similar workflow to the web client and server developers. We merge in to a shared development branch when we have a complete feature or bugfix. With git's --no-ff this allows us to see when a new feature was implemented, and when bugs pop up we have a clear list of intersections where they could have been introduced. Our workflow is roughly based on an excellent post by Vincent Driessen, http://nvie.com/posts/a-successful-git-branching-model/.
dgoujard · 2014-01-12
One common best practice is http://nvie.com/posts/a-successful-git-branching-model/
You can use http://danielkummer.github.io/git-flow-cheatsheet/ also to help branch handling.
kalms · 2013-04-30
If people are still struggling with this, I can recommend looking into the git flow model. You can read more here: http://nvie.com/posts/a-successful-git-branching-model/
i386 · 2012-10-15
Unlike Subversion, Git has cheap branching and excellent merging which make branches an easy way to avoid 50 odd developers stamping on each others changes when they commit to master. I recommend checking out Git Flow which is a workflow for managing git branches.
See http://nvie.com/posts/a-successful-git-branching-model/
Using a CI server to test merging branches back to master and running the tests make it a lot easier to know when its safe to merge back to master (I left a comment in the comments earlier about how this can be done).
jeromeparadis · 2011-07-02
I've adopted the following branching model: http://nvie.com/posts/a-successful-git-branching-model/
Works like a charm for us.
It doesn't mean we don't update production as often as possible but we sure sometime need to push hot fixes to production quickly while working in parallel on new features. I would say branching is a necessary evil.
thushan · 2011-02-10
This isn't so much as a toolbox item but a must read I think
http://nvie.com/posts/a-successful-git-branching-model/
SkyMarshal · 2010-12-12
>Git is very popular in the Rails community, but there are probably no two companies using git the same way.
For anyone not already aware of it, I recommend checking out Git Flow. It's a set of git extensions that standardize the git workflow:
https://github.com/nvie/gitflow
Some articles:
http://nvie.com/posts/a-successful-git-branching-model/
http://news.ycombinator.com/item?id=1617425
scrrr · 2010-09-14
Yes it's a zen thing. But git after a while just pulls you in. From a marketing stand-point it's the awesome product kind that doesn't even need marketing. Word will spread on it's own. And does.
btw, my favorite post on git still is http://nvie.com/posts/a-successful-git-branching-model/ .
jsarch · 2010-08-17
In my own startup we're using git to handle our version control as well. As mentioned in the article, git is flexible enough to allow you to create your own workflow, which is what we did when we started.
However, our workflow became much too convoluted and we switched to gitflow by Vincent Driessen (nvie.com). In fact, there are similarities between gitflow and the braintree workflow but gitflow now has as a git "flow" module to help you out.
If you haven't checked out gitflow, I highly recommend it. Here's the original post that started it all: http://nvie.com/git-model
Has anyone else found git workflows that work well for them?
theBobMcCormick · 2010-05-13
My two favorite resources for getting started with git:
1) Using Git with a central repository: http://toroid.org/ams/git-central-repo-howto
2) A succesful Git branching model: http://nvie.com/git-model
shayanjm · 2015-02-11
No, I wouldn't hire you as-is. Probably not a first-choice intern either.
Some notes on why not:
+ Your web-sume looks rough. As pointed out by others, there are a number of typos (i.e: "and provide an opporunity") not to mention the design itself could use work. If you are GREAT at web design/UX you should spruce it up. Otherwise, kill it and move to a traditional resume. Knowing HTML5/CSS3 today is pretty meaningless, so showcasing that is sort of pointless.
+ There are tons of issues with your resume itself (i.e: "Excellent verbal and written communication skills." despite multiple typos and unclear flow) which need to be addressed. Cut the fluff, point to recent projects & address why they are cool/why anyone should care. Anything that you did 10+ years ago that isn't directly applicable to what you want to do in the near future has no place on the resume.
+ Your bitbucket projects are lackluster. You don't follow good git branching habits, your commits are non-atomic, your code is cumbersome and unfinished in many places. You also seem to use .py files as notes in non-standard ways, introducing weird artifacts and conventions to your projects.
Some notes on how to improve:
+ Learn how to use git productively in a team environment (this means no more working directly out of master). This is a good resource to that end: http://nvie.com/posts/a-successful-git-branching-model/
+ Learn better coding habits in whatever language(s) you are most comfortable with. Your…
Walkman · 2014-08-03
No offense, but seems your problems coming your unwillingness to learn git properly. If you would take the time and learn it (reading Pro Git book, learning from visual tools, which there are a ton, etc) (Again, no offense, just suggestion.)
> Huge number, about 148, of commands with many sub-commands that often do non-obvious, even unrelated things.
You don't need to know all 148 of them. If you only know 16 (1/9 of them): add, branch, checkout, commit, config, fetch, log, pull, push, rebase, reflog, remote, reset, show, stash, status, You can do pretty complex things already. For day-to-day usage, these are more than enough.
> git rebase enables users to rewrite history which subverts what should be the main, if not only, function of a version control system.
Git rebase enables very simple workflows, like the GitHub workflow[1], which IMO is quite simple, small overhead workflow, pretty useful and scalable.
Git rebase is also for local repo only. In every tutorial and even git command recommends against pushing rebased branches to an already pushed remote repository. If you keep this in mind, it makes sense.
> ... to rebase heavily to create a false history presenting themselves as fantasy 10X programmers who don't make mistakes, ...
I think the reason is not that they want to hide their mistakes, but to clean the history. Would you rather see typos in a history? IMO it's just cruft, an amend or rebase pretty much just a clean up you can read it more easily, and you…
MBCook · 2013-09-27
I think Git is much easier to understand if you understand the underlying data model. The core object in Git (as far as you need to care) is a commit. Each commit holds a link to the commit(s) it was based on. If two commits have the same parent, you have two branches. If one commit has two parents, it's a merge. Individual commits don't know what branch(es) they are a part of.
Branches are just pointers to commits. When you make a new commit on a branch, the new commit is saved and the branch pointer is moved forward to point to the new commit.
Tags point to branches, but they don't get updated. They're supposed to be permanent (but can be modified if you try). If a tag points at a commit and you make a new commit, the tag still points to the original commit.
The only other odd term would be HEAD, which is like a branch that ALWAYS points at what you have checked out at the moment. You'll see this if you make commits without being on a branch (say you checked out an old commit and just started working).
Since branches are just pointers at commits, you can move them around easily. If you make 6 new branches, they all just point at the same commit to start, which is why it's so amazingly fast to do. If you want to undo a commit (that you haven't pushed), you can move the branch pointer to a previous commit. After that when you make new commits it will be like the mistake never existed. (Note: If you accidentally do this, it can be fixed if you catch it soon enough).
When…
arsenerei · 2013-08-04
I am a huge fan of Gerrit, other than its UI. I ran it along with Jenkins[0] at a previous company. Its review model is far, far, far superior to Github's. As you said, it keeps successive patch sets, and allows for diffs against previous patch sets, rather than only against the original parent. This allows for you to see only the most lastest changes, so you don't have to wonder if anything else was changed and review the entire patch.
> $ git review
I actually wrote a bash script with the same name and a few other shortcuts before my company started working on OpenStack. I was quite pleased with the workflow I provided the team I was on.
$ git start <new-branch> <branch-from>
$ <do work as normal>
$ git review
$ git finish # removes the branch
These three commands along with the git-flow branching model[1] (but not the tool itself), leads to clean, sensible history in my opinion.
I respect that Github tries to maintain a low-barrier of entry to increase use and ease, but I believe there's a way to maintain it while still having a great patch-review model.
0: http://jenkins-ci.org/
1: http://nvie.com/posts/a-successful-git-branching-model/
jlgreco · 2012-11-30
It is obviously a hard thing to quantify, but relative pain of branching and merging is apparent through the different version control styles commonly advocated/actually seen for both systems. As a simple example, while this (http://nvie.com/posts/a-successful-git-branching-model/) is certainly possible in SVN, I have never actually seen an SVN shop consistently doing that. To the extent that any I have seen do follow that model, they do so essentially at gunpoint, not because it is a pleasant thing to do. On the other hand that sort of thing is exceedingly simple and pleasant in git. As a consequence, in the real world, people are much more willing to employ both with git without any hesitation at all.
Also poorly quantifiable is the sense of fear or anticipation that courses through your veins when you hear the phrase, in an SVN shop, "Hey, I've got a feature branch I want to merge in."
jonpaul · 2012-07-02
Thanks for taking the time to provide some feedback. The article that you presented was really interesting and despite being over 15 years old, it seems that its insights are still valid today.
Regarding Gitpilot, I think that our biggest problem at the moment is that maybe we are miscommunicating its value proposition. As it's a compliment to Github and not a replacement. I think you'd also find that it's at least attempting to be goal oriented as opposed to being task oriented like most Git GUIs. For the sake of brevity, Gitpilot is best described as a git-flow GUI [http://nvie.com/posts/a-successful-git-branching-model/, https://github.com/nvie/gitflow/]. (Our branching model is a bit different though)
It is Mac specific at the moment and it's currently awaiting review for the Mac App store. If you're interested, when it's live, I'll send you and your team promo codes so that you can try it out at no cost. If so, send me an email to jp [AT] gitpilot.com
Thanks again.