Apr 28, 2011

Helpful git-svn cheatsheet

git

In my previous post “A successful git-svn workflow“, I wrote about starting out with git-svn.  This post is a followup with notes on more advanced topics.

Git SVN Branching

First Find the revision that you want to branch from:
git svn find-rev r7654

Check it out:
git checkout b0ec4f9bef566

Then actually create the branch in SVN:
git svn branch <branchName>

you should be able to see a new branch in
https://<your svn repo URL>/branches/

Cherry picking changes

Checkout the remote branch:
git checkout remotes/release-1.2.1

Create a local branch tracking with that remote:
git checkout -b release-1.2.1

Cherry pick your changes:
git cherry-pick 91721c344e3
git cherry-pick fabbed1

then commit it
git svn dcomit

Create a new Git Branch

from http://djwonk.com/blog/2009/04/18/tracking-remote-git-branches/

Push your local branch upstream:

“In my opinion, Mark Eli Kalderon’s post explains the simplest and most elegant approach. Here is his approach, slightly adapted:

  • $ git checkout -b zzz
  • # Let the hacking commence…
  • $ git push origin zzz
  • $ git checkout master # see note 2
  • $ git branch -f zzz origin/zzz
  • $ git checkout zzz
  • # Let the hacking continue…

The key to this approach is using the “-f” flag with “git branch” to force the re-creation of the local branch. It is short and easy to remember.”
Then to track an existing upstream branch:

  • $ git branch –track zzz origin/zzz

About the Author

Object Partners profile.
Leave a Reply

Your email address will not be published.

Related Blog Posts
Natively Compiled Java on Google App Engine
Google App Engine is a platform-as-a-service product that is marketed as a way to get your applications into the cloud without necessarily knowing all of the infrastructure bits and pieces to do so. Google App […]
Building Better Data Visualization Experiences: Part 2 of 2
If you don't have a Ph.D. in data science, the raw data might be difficult to comprehend. This is where data visualization comes in.
Unleashing Feature Flags onto Kafka Consumers
Feature flags are a tool to strategically enable or disable functionality at runtime. They are often used to drive different user experiences but can also be useful in real-time data systems. In this post, we’ll […]
A security model for developers
Software security is more important than ever, but developing secure applications is more confusing than ever. TLS, mTLS, RBAC, SAML, OAUTH, OWASP, GDPR, SASL, RSA, JWT, cookie, attack vector, DDoS, firewall, VPN, security groups, exploit, […]