TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Comparing Git Workflows

268 pointsby AJAlabsalmost 9 years ago

12 comments

drewg123almost 9 years ago
One of the things I hate about the traditional git workflows describe there is that there is no squashing and the history is basically unusable. We have developers where I work that use our repo as a backup, then when things are merged to master, the history is littered with utter garbage commits like the following: &quot;commit this before I get on the plane&quot; &quot;whoops, make this compile&quot; &quot;WTF?&quot;<p>These add no benefit to history, and actually provide an impediment to bisecting (since a lot of these intermediate revisions will not even compile).<p>At my previous job, we used gerrit. The nice thing about gerrit from my perspective is that it kind of &quot;hid&quot; all of the intermediary stages in the gerrit review. So you could push all you wanted to your gerrit review fake-branch thing, and when you finally pushed to master, there would just be a nice, clean atomic change for your feature. If you needed more detailed history of the steps during review, it was there in gerrit. But master was clean, and bisectable.<p>Is there any git other git tool or workflow which both allows people to back things up to the central git repo AND which allows squashing changes down to meaningful bits, AND which does not loose the history of review iterations?
评论 #11778523 未加载
评论 #11784845 未加载
评论 #11778498 未加载
评论 #11778497 未加载
评论 #11780103 未加载
评论 #11784990 未加载
评论 #11781289 未加载
评论 #11779363 未加载
评论 #11785583 未加载
评论 #11779259 未加载
评论 #11778492 未加载
评论 #11783599 未加载
评论 #11778878 未加载
评论 #11778843 未加载
评论 #11778505 未加载
评论 #11782933 未加载
评论 #11782250 未加载
useryMcUserfacealmost 9 years ago
This article has actually been around for a while. Explains it really great. But one advice from me is that try to choose only what is sufficient to your project and team. No benefit in being overequipped for a simple job.
评论 #11778349 未加载
评论 #11778503 未加载
zamalekalmost 9 years ago
You can also evolve, basically, to each model in the order that they appear in the article.<p>As an example: I&#x27;ve been working on a new spike for the past 2 weeks with one other developer. Maybe 10 times a day we&#x27;ll need something that the other person has committed, so we work against one branch (master). The workflow suits this extremely rapid iteration.<p>One repo has now matured to the point where developer branches make sense. We created &quot;develop&quot; on it as well as our own branches off that. We&#x27;re not close to a v0.1 yet - but we&#x27;ll be evolving to git flow the minute we want to ship.<p>Eventually as more devs join, we&#x27;ll need the full-blown PR workflow, that also naturally stems from its predecessor.<p>There&#x27;s a &quot;meta-workflow&quot; here, which implies which workflow to use.
评论 #11780065 未加载
评论 #11780064 未加载
zmmmmmalmost 9 years ago
It amazes me how the entire software industry seems to be adapting its workflows around the necessity of making Git usable. While there are certainly other positive attributes about some of these workflows, the main reason people use them in my experience is because &quot;if you don&#x27;t use workflow X you get undesirable problem Y with Git&quot;. Most of these problems simply didn&#x27;t exist or were not nearly as severe with previous revision control systems, so we never needed these elaborate workflows. Now suddenly Git is considered a defacto tool, and downstream effects of using it are transforming the entire software development process.
评论 #11782627 未加载
评论 #11783002 未加载
评论 #11782691 未加载
nwatsonalmost 9 years ago
The article completely mischaracterizes Subversion workflows, making the mistake of treating a Subversion repo just like developers typically use git repos ... one-repo-per-project.<p>Subversion instead is a tree with projects as nodes toward the leaves, each project with its own trunk, branch, tags. It&#x27;s each of these projects that corresponds to a git repo. Teams I worked on always treated each project as its own &quot;repo&quot; ... so the central single Subversion tree became like our &#x27;github&#x27; or &#x27;bitbucket&#x27; ... and one could do all the lockless branching within each project, no problem. YOU COULD BE AS NON-LINEAR IN THIS APPROACH AS YOU NEED TO BE, with full support for branching, tagging, merging, etc.<p>Where Subversion was much better was in supporting consolidated views of multi-project build &#x2F; release environments, or in mixing sub-project code in parent-project code. Using svn:external it was each to put &quot;that subproject in this place in my own project&quot;. Using git submodules and other approaches is a pain. You end up having to check out a bunch of git repos and managing your own glue.
EnderMBalmost 9 years ago
It&#x27;d be nice to see someone collate more git workflows, and what the advantages and disadvantages of these are.<p>Over time, my workflow has become simpler and simpler. I&#x27;ve worked with some weird and wacky workflows before, which have been born from a given requirement, such as quick deployment to a number of different environments, or two separate teams working on separate parts of one codebase while maintaining separate CI workflows. Some of these workflows have seemed absolutely mental, but I&#x27;ve seen them several times over in different places, so there must be some kind of logic to the madness.<p>Different dev teams have wildly different practices, so it&#x27;d be good to acknowledge the &quot;typical&quot; way of doing things, and embracing the workflows that work if you need to do something out of the ordinary.
crispyambulancealmost 9 years ago
Kudos to atlassian for bringing some much needed clarity to a confusing topic. So many people that claim mastery of git only know particular workflows and, when attempting to mentor others, just mansplain whatever they know without consideration that there are alternative valid ways of doing things.<p>Without a firm grasp of one&#x27;s intent(workflow) learning git commands is pointless and leads to people desperately flailing out commands.
评论 #11782476 未加载
sytsealmost 9 years ago
I think the ideal workflow depends on the complexity you need. I&#x27;ve tried to write about what kind of requirements cause what kind of workflow in <a href="http:&#x2F;&#x2F;docs.gitlab.com&#x2F;ee&#x2F;workflow&#x2F;gitlab_flow.html" rel="nofollow">http:&#x2F;&#x2F;docs.gitlab.com&#x2F;ee&#x2F;workflow&#x2F;gitlab_flow.html</a><p>What do you think?
axelfontainealmost 9 years ago
Or you could actually practice <i>continuous integration</i> and let everyone work on master.<p>Much simpler, opens the door for feature toggles, continuous delivery and more without any merge headaches.
jupp0ralmost 9 years ago
Those are general development models and not specific to git.
kevinSuttlealmost 9 years ago
Was this updated recently? This has been up for awhile.
评论 #11782329 未加载
Bromsklossalmost 9 years ago
What was the workflow in mind when Git was designed?