GIT-CREATE-BRANCH(1)

🌸 NAME 🌸

git-create-branch β€” bestie, we are making branches πŸ’…


✨ SYNOPSIS ✨

okay so the original page literally does not give you a synopsis line here. it's giving mysterious. iconic of it, honestly πŸ’€ β€” the flags get explained down in OPTIONS anyway.


πŸ’– DESCRIPTION πŸ’–

It creates a local branch named <branchname>, and optionally sets up a remote tracking branch too. that's the whole vibe. two-for-one if you ask nicely 🫢


πŸ‘‘ OPTIONS πŸ‘‘

  • remote tracking setup β€” Set up a remote tracking branch using remote_name. If remote_name is not supplied, origin is used by default. (yes bestie, origin, the default one, no cap)
  • --from [start_point] β€” Setup a start point when the branch is created. If --from is not supplied, the current branch is used by default. so it's like, "start me from here," and if you don't say where, it's wherever you're standing rn 🌈
  • <branchname> β€” The name of the branch to create. duh, but fr fr, you do have to give it one πŸ’–

πŸŽ€ PREFERENCES πŸŽ€

You can save your own default for the remote option up there by using git config, with the key git-extras.create-branch.remote β€” whatever value you give it becomes the default remote whenever [-r|--remote] isn't specified. set it and forget it, queen πŸ‘‘

$ git config git-extras.create-branch.remote lucinda

and when you do pass the command line option -r|--remote, that overrides the preference. the CLI stays undefeated ✨


πŸ¦‹ EXAMPLES πŸ¦‹

With no remote preference set:

# creates local branch 'integration'
$ git create-branch integration

# creates local & remote branch 'integration' (on default 'origin')
$ git create-branch -r integration

# creates local & remote branch 'integration' on 'upstream'
$ git create-branch -r upstream integration

With the git-extras.create-branch.remote preference set to 'lucinda':

# creates local & remote branch 'integration' (on preference 'lucinda')
$ git create-branch integration

# overriding preference, using default `-r` of 'origin'
# creates local & remote branch 'integration' on default 'origin'
$ git create-branch -r integration

# overriding preference, using specified `-r` of 'upstream'
# creates local & remote branch 'integration' on 'upstream'
$ git create-branch -r upstream integration

⭐ NOTES ⭐

  • As of 4.4.0, the default behavior has changed. git-create-branch will no longer automatically setup a remote tracking branch unless the -r|-remote option is specified. See the additional note on the preference feature in 4.8.0-dev below. ⚠️ so if you're on autopilot expecting a remote branch, bestie, she's not coming unless you ask.
  • As of 4.8.0-dev, the remote option can be set via git config preference, as described in the Preferences section. πŸ‘‘

πŸ’œ AUTHOR πŸ’œ

Written by Jonhnny Weslley <jw@jonhnnyweslley.net>. Modified by Mark Pitman <mark.pitman@gmail.com>, Brian Murrell <btmurrell@gmail.com>. shoutout to the devs, they ate 🫢


😭 REPORTING BUGS 😭

<https://github.com/tj/git-extras/issues>

found something cursed? take it straight to the issues, no cap.


🌈 SEE ALSO 🌈

<https://github.com/tj/git-extras>


and that's the whole page, bestie β€” this little legend lives in Git Extras and it's dated May 2026. stay branched, stay slaying πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from