- Word of the day: Ouch.
- I’m done with the cancer, but the cancer isn’t done with me
- Goodbye, my dopey dog.
- So long, Alex King
Polluting the internet since 2004
I finally got fed up with some repetitive Git tasks and decided to make a few aliases in my
.gitconfig file. Here are the commands, they all assume that they’re run from a valid git repo:
How often do you repeat the git command to push your current branch by typing
git push origin [current-branch-name] because you never remember to set up the branch to track? Does this sound easier?
Alternately, here, you can add a default push method to your
So that you can just call
git push to and have git automatically assume you typed
git push origin [branch-name]
With larger groups of developers it is easy for a
git pull to fetch a lot of new refs that you don’t care about. This alias shortcuts
git pull origin [current-branch-name].
A quick and easy update of just what you care about. Save big the
git pull for lunch time or a coffee break.
We use GitHub Enterprise at work and going to look at the current branch/repo on the server is pretty common. So to make it super quick to get where you want to go this command will open up the GitHub server to the current repo and branch that you’re on. This works with self-hosted GitHub FI/Enterprise installs as well as public GitHub.
As a part of using GitHub Enterprise at work we’ve heavily adopted Pull Requests as the primary method of requesting code reviews and for pulling approved code in to master. However constantly finding the branch or manipulating browser history becomes tiresome. So this alias opens up GitHub to ‘
/owner/repoName/pulls/new/current-branch-name‘ so that you can fill in a detailed pull request (you are filling out a pull request with a description and testing plan, right?).
I don’t now about you, but I’ve not been able to get on board with the dedicated git apps for browsing and visualizing history trees, but once in a while I do want to look at the tree but don’t want to load an app to do it when a simple view on the cli will do.
Ok, its pretty straight forward. Just add this to your
Are those ugly? Sure. Do they help? Yep!
I’m sure as time goes on I’ll figure out a few more. Or maybe the three of you that actually read this far have suggestions? Lemme know.
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Comments are closed