Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer. You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now!

Make git work better with GitHub

A few months ago I installed a command line utility called hub. I’m really fond of it. It’s aim is to make it easier to interact with GitHub from the commandline. It’s a wrapper around the standard git command. Once it’s installed you can do stuff like this (take from the manual page)

# clone your own project
$ git clone dotfiles
→ git clone git://github.com/YOUR_USER/dotfiles.git

# clone another project
$ git clone github/hub
→ git clone git://github.com/github/hub.git

# open the current project's issues page
$ git browse -- issues
→ open https://github.com/github/hub/issues
# Example workflow for contributing to a project:
$ git clone github/hub
$ cd hub
# create a topic branch
$ git checkout -b feature
  ( making changes ... )
$ git commit -m "done with feature"

# It's time to fork the repo!
$ git fork
→ (forking repo on GitHub...)
→ git remote add YOUR_USER git://github.com/YOUR_USER/hub.git

# push the changes to your new remote
$ git push YOUR_USER feature
# open a pull request for the topic branch you've just pushed
$ git pull-request

Want to use all this cool stuff too? Head over to the installation instructions on GitHub.

Freek Van der Herten is a partner and developer at Spatie, an Antwerp based company that specializes in creating web apps with Laravel. After hours he writes about modern PHP and Laravel on this blog. When not coding he’s probably rehearsing with his kraut rock band. He loves waffles and butterflies.