7

Git Workflow with branches

 4 years ago
source link: https://www.otsukare.info/2011/08/03/git-workflow-with-branches
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Git Workflow with branchesotsukare Thoughts after a day of work

Git Workflow with branches

Mer 03 août 2011by Karl Dubost (Worked at Opera from 2010 to 2013)

Mike shared a good recommendation for working together with git. Posting it here for not forgetting.

\ Create a new branch, and work inside of it:\

$ git checkout -b new_branch

Do some work, make a handful of commits\

$ git commit -am 'commit 1'
$ git commit file.whatever -m 'commit 2'

I'm done with this feature now, back to master\

$ git checkout master

Merge in my branch's work--but squashing all commits from new_branch into one\

$ git merge new_branch --squash

Commit all that work as a single public commit\

$ git commit -am 'adding feature X, blah blah'

This article is published with a CC0 license

Karl Dubost on otsukare


Recommend

  • 75
    • geeks.uniplaces.com 6 years ago
    • Cache

    Mastering git branches – uniplacesgeeks

    Branches are one of the most misunderstood concepts in git and yet they are so simple to understand. How many uncomfortable situations have you been when dealing with branches? All the rebases and…

  • 9
    • shannoncrabill.com 4 years ago
    • Cache

    Orphan Branches in Git

    Shannon Crabill — Front End Software EngineerSkip to content You may run into a situation where a branch of a project doesn’t need to share history wi...

  • 10

    Reworking Git Branches with git filter-branch Posted at Mar 16, 2020 Within Debezium, the project I’m working on at Red Hat, we recently encoun...

  • 12
    • pawelgrzybek.com 4 years ago
    • Cache

    Remove all git branches except master

    Remove all git branches except masterPublished: 2020.12.20 | 1 minutes readAfter working on a project for a while, it’s easy to end up with a lot of legacy branches that are not needed anymore. Removing them one by one would b...

  • 15

    Dealing with changes to git default branches As you may have heard by now, the default git branch name is changing from master to main

  • 11

    The Mike Taylor method™ of naming git branches 22 Jan 2021 I thought I would document how I do branching in git because it’s clearly the best a perfectly acceptable way to do...

  • 7
    • elijahmanor.com 3 years ago
    • Cache

    List Recent Git Branches

    This post is part of my Byte Series, where I document tips, tricks, and tools that I've found useful.If you are anything like me, you have a lot of branches in your local projec...

  • 5
    • devhints.io 3 years ago
    • Cache

    Git branches cheatsheet

    Creating git checkout -b $branchname git push origin $branchname --set-upstream Creates a new branch locally then pushes it. Getting from remote git fet...

  • 5

    Erik Smith Posted on Oct 30...

  • 14

    After updating git, the new upstream branches are visible but are not originating advertisements First my terminology: "ups...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK