Giter Site home page Giter Site logo

git-svn-scripts's Introduction

git-svn-scripts

Bash scripts to help instrument a reasonable workflow with git svn

Inspiration

These scripts are influenced heavily by Rein Henrichs’ post entitled hack && ship.

Contributors

Many thanks to Tanner Donovan for pairing with me on these scripts.

Setup

To use these scripts:

  • Edit g-init to point to your SVN repository
  • Ensure these scripts are available in your $PATH

Typical Workflow

  • Initialize a git repository, based on your SVN repo
    • $ g-init
      • This is done only once
  • Make a feature branch:
    • $ g-branch branchname
      • This updates master from SVN trunk, creates a branch branchname and switches to that branch
  • Go about your business, commit early and commit often
  • Merge-out from SVN trunk via the master git branch, to keep nice and fresh:
    • $ g-update
  • When the time is right, ship that feature branch back to SVN
    • g-ship
      • This uses g-update to ensure your feature branch is fresh
      • This squashes commits made in your feature branch, keeping a tidy single commit message per feature branch merge
      • This requires that your tests all pass, by default (See source for overriding option)

Patch-based workflow

Sometimes you may find yourself working with collaborators that do not have commit access to the trunk of your SVN repository. This simple workflow uses patches to submit and accept changes from git feature branches.

  • Follow the workflow outlined above, right up until shipping the feature branch. g-ship will fail if you do not have write access to SVN trunk.
  • Create a patch to represent the changes made in your feature branch:
    • $ g-create-patch
      • This uses g-update to ensure a fresh feature branch
      • branchname.patch is created as output, which can be sent via email or attached to a ticket
  • A developer with commit rights to the SVN repo can then apply the patch:
    • $ g-apply-patch branchname.patch
      • This updates master from SVN and creates a branch matching branchname (the basename of the patch file)
      • The patch is applied to the feature branch
      • After you have approved the changes, you can ship them via g-ship

Feedback

I’m very open to feedback on the general workflow presented here, as well as the specific implementation in git. Fork away!

git-svn-scripts's People

Contributors

briandoll avatar bdoll avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.