Git sub-tree merging back to the subtree for pushing to an upstream

While git sub-tree merge strategy works great for merging a library into vendor (when you want to pull HEAD on that library instead of waiting for releases), I had trouble finding documentation on pushing back to upstream.  This is annoying because one of the most obvious times you may want to use subtree is when you manage the library yourself, so can just pull straight from the repo, and want to push your maintenance changes back.

Surprisingly, and not what I have come to expect from git, it just works.  From the example in the docs I linked, when you are checked out on master

git merge --squash -s subtree --no-commit rack_branch

will merge the rack_branch into where you have specified.  But it just works the other way to.  If checked out on rack_branch

git merge --squash -s subtree --no-commit master

will do what you expect, so you can now just push your library branch back to it's upstream.

Awesome!

Filed under  //   git   tech  

Comments [4]

Tagging a git release with current branch name and date

Either add this to your .git/config

[alias]
datetag = !git tag `git name-rev --name-only HEAD`-`date \"+%Y%m%d%H%M\"`

or run it in your project folder to add it to the config for that project:

git config alias.datetag '!git tag `git name-rev --name-only HEAD`-`date "+%Y%m%d%H%M"`'

Then you can just run 'git datetag' to create a new tag to use as a release

Filed under  //   deployment   git   hosting   tech  

Comments [0]

Filed under  //   git   tech  

Comments [0]

Filed under  //   blogging   git   link   tech  

Comments [0]

Filed under  //   git   scm   tech  

Comments [0]

Filed under  //   git   scm   tech  

Comments [0]

Filed under  //   git   scm   tech  

Comments [0]

Filed under  //   dreamhost   git   scm   tech  

Comments [0]

Filed under  //   dreamhost   git   scm   tech  

Comments [0]