My previous workflow in my personal project was like this:
git checkout -b awesome-feature
- Edit file
git add .; git commit -m 'created awesome feature'
git push origin awesome-feature
hub pull-requestUsing hub command
- Open GitHub PR page
- Press the "Merge Button"
Although I use some alias in Git,
Open GitHub PR page and
Press the "Merge Button" are stressful task. I cannot be patient of browser loading!
Basically, I don't need to review my own Pull Request for my personal project, so I create a tiny function to merge Pull Request from command line:
function merge set repo (pwd | perl -pe 's#.+github.com/##') curl \ -XPUT \ -H "Authorization: token $GITHUB_TOKEN" \ https://api.github.com/repos/$repo/pulls/$argv/merge end
Use that command like this:
It assumes that you are in
/path/to/github.com/user/repo. You can also use
git remote -v to get current directory's repository info.
I publish my dotfiles to GitHub, so I made
GITHUB_TOKEN environment variable, which is very sensitive info.
One of the most consolidated misconceptions about programming, since the early days, is the idea that such activity is purely technical, completely exact in nature, like Math and Physics. Computation is exact, but programming is not.