Curry-style command to git checkout
files
Name | Link |
---|---|
Project Home: | https://github.com/davidosomething/git-take |
Remembers the last branch you called git take
with (persistes across sessions
via storage in local git config), and provides a shortcut to
git checkout BRANCH FILE
.
- Add the
git-take
file somewhere in your path, e.g./usr/local/bin/
zplug "davidosomething/git-take", as:command
From command line execute:
git take BRANCH FILENAME
This will essentially call
git checkout BRANCH FILENAME
but with the added benefit that it remembers the BRANCH
on future calls.
Then, you can call
git take SOMEOTHERFILE
while will automatically assume you want SOMEOTHERFILE
from the previously
specified BRANCH
-- e.g.
git checkout BRANCH SOMEOTHERFILE
Sometimes I start a feature branch and find some bugs that I fix in that branch. Those bug fixes should really go into a bugfix branch and be integrated separately. So I would have:
git checkout -b feature
to start working on a feature (topic) branch.- Fix up some bugs that I discover in
fixedfile1
andfixedfile2
git checkout bugfix master
to create a new clean branch off of master.git take feature fixedfile
- Using the shortcut I can now
git take fixedfile2
without having to re-type the branch name (andgit take fixedfile3
, etc.) git commit
to thebugfix
branch (orgit reset
andgit add -p
to patch in)
MIT Licensed
Copyright (c) 2015 David O'Trakoun me@davidosomething.com