forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
Git Workflows
Phillip Cloud edited this page Sep 6, 2013
·
9 revisions
From @cpcloud:
My pandas workflow usually goes something like this:
- Always use
virtualenvwrapper
. Period. Then I doworkon pandas
. - Depending on how much time I have I'll try to prioritize based on some combination of which issues are high-priority and those for which I see an easy fix and those that I think would be fun to work on.
- Once I've selected an issue I'll start hacking on it. I usually don't use any local branches unless I'm implementing something new and there's a bunch of things for that feature that can be worked on separately.
- I use
git stash
all the time. In fact so much so that I have aliases for everygit stash
subcommand. Often times I'll get interrupted and I'll need to stash something so I do. I can then come back to it. If you end up accumulating a crap ton of stashes (which I do) then you can inspect them withgit stash list
followed bygit stash -p stash@{0}
or whatever stash number you want to see the diff of. I'll also occasionally prune the stash via visual inspection and/or my own memory of what's been merged recently or by comparison of stashes toupstream/master
. - Two things that I use a lot are the command
git push -u origin $(git rev-parse --abbrev-ref HEAD)
. This pushes a remote branch with the same name as the one that I made locally to theorigin
remote (my fork). I havegit rev-parse --abbrev-ref HEAD
aliased togcb
which I remember as "git current branch". The other command I use ishub pull-request -b pydata:master
which automatically submits a PR. I can essentially push the remote and the PR in a single step on the command line without having to use the mouse. Pretty neat. -
git reflog
is great for those times when you accidentally typegit reset --hard
and you need to recover something. - Finally I'll rebase using
git rebase upstream/master
to pull in the latest from theupstream
remote (which I have set tohttp://github.com/pydata/pandas.git
) - Throughout the dev process I'm constantly doing
git fetch && git rebase upstream/master
, although recently I've toned that down a bit and I've started to just do it when I need to. - I also use
git log
all the time. Since the standardgit log
is a bit too verbose I use scm_breeze and it has a gorgeous standardgit log
(as long as you've setgit config --global color.ui auto
!)