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!
![CSS Animations Between Media Queries]()
CSS animations are right up there with sliced bread. CSS animations are efficient because they can be hardware accelerated, they require no JavaScript overhead, and they are composed of very little CSS code. Quite often we add CSS transforms to elements via CSS during...
![Animated 3D Flipping Menu with CSS]()
CSS animations aren't just for basic fades or sliding elements anymore -- CSS animations are capable of much more. I've showed you how you can create an exploding logo (applied with JavaScript, but all animation is CSS), an animated Photo Stack, a sweet...
![background-size Matters]()
It's something that makes all men live in fear, and are often uncertain of. It's never spoken, but the curiosity is always there. Nine out of ten women agree in the affirmative. Advertisers do their best to make us feel inadequate but...
![Form Element AJAX Spinner Attachment Using MooTools]()
Many times you'll see a form dynamically change available values based on the value of a form field. For example, a "State" field will change based on which Country a user selects. What annoys me about these forms is that they'll often do an...
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