Set a Default Push Remote with git

Publikováno: 27.3.2018

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 […]

The post Set a Default Push Remote with git appeared first on David Walsh Blog.

Celý článek

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!

The post Set a Default Push Remote with git appeared first on David Walsh Blog.

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace