-2

In the manual it states that -u will tell git to remember where to push to.

However, I think this is a strange abbreviation. -r would make more sense.

It works fine I'm just wondering where these abbreviations come from.

Chris Martin
  • 30,334
  • 10
  • 78
  • 137
cade galt
  • 3,843
  • 8
  • 32
  • 48

1 Answers1

1

it means

--set-upstream

and that means:

git push --set-upstream sets the default remote branch for the current local branch.

(see this answer)

Community
  • 1
  • 1
Chris Maes
  • 35,025
  • 12
  • 111
  • 136
  • [-u | --set-upstream] – Chris Maes Jan 18 '16 at 19:45
  • 1
    why are you so hung up on how much sense it makes? `-u` is just fine – user1231232141214124 Jan 18 '16 at 19:47
  • in general there are two kind of options for most programs: **short options** : one dash, and one letter (for example `-u`) and **long options**: two dashes and then a word of any length (for example `--set-upstream`) – Chris Maes Jan 18 '16 at 19:50
  • 2
    @cadegalt Actually -su would be highly confusing for most Linux users. Abbreviated command line options typically consist of a single letter, and having two letters means you are using two separate options at once i.e. the average user would expect `-su` to be equivalent to `-s -u` – JBentley Jan 18 '16 at 19:50
  • @cadegalt Also bear in mind that most people who use the command line are doing so because it offers efficiency benefits over a gui. Forcing a user to unnecessarily type two letters instead of one is counterproductive. If you want the option to be easy to remember, then that is what the long form is for. When you have two options - (1) quick, (2) easy to remember; why have an option that sits in between the two? – JBentley Jan 18 '16 at 19:52