Set a Default Push Remote with git
During my early days of git usage, my config allowed me to simply type git push
instead of git push {origin} {branch_name}
which I need to now. Up until recently I needed to type out the long version...(I know)...which was incredibly annoying because I like using detailed branch names.
I'd finally had enough of the copy and paste branch name madness and decided I wanted git push
to always push to my origin and the same branch name:
git config --global push.default current
There are a number of push.default
values you can use but in most cases, especially when you have a GitHub workflow, current
is likely the value you want to use. Also, since we're using --global
, this will be the default for all repositories!
I was inspired when I first saw Addy Osmani's original ShineTime blog post. The hover sheen effect is simple but awesome. When I started my blog redesign, I really wanted to use a sheen effect with my logo. Using two HTML elements and...
The HTML5 revolution has provided us some awesome JavaScript and HTML APIs. Some are APIs we knew we've needed for years, others are cutting edge mobile and desktop helpers. Regardless of API strength or purpose, anything to help us better do our job is a...
As broadband speed continues to get faster, the web continues to be more media-centric. Sometimes that can be good (Netflix, other streaming services), sometimes that can be bad (wanting to read a news article but it has an accompanying useless video with it). And every social service does...
Grabbing emails from your Gmail account using PHP is probably easier than you think. Armed with PHP and its IMAP extension, you can retrieve emails from your Gmail account in no time! Just for fun, I'll be using the MooTools Fx.Accordion plugin...
Thanks for sharing, David. That’ll save me considerable time.
Love this one ! Thank you for sharing.
For anyone who doesn’t want to set it local, you can also do git push origin –set-upstream per your local branches: https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches
How do you set the default for pull? For an open source fork I have, I want
git pull
to default togit pull upstream special-dev-branch
?I’d second Devin Rhode’s question