From 4b73f49bc294d1388836553f400ad55c9f436577 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sat, 1 Oct 2022 15:33:59 +0300 Subject: [PATCH] Add automatic upstream branch creation --- snippets/automatic-push-upstream.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 snippets/automatic-push-upstream.md diff --git a/snippets/automatic-push-upstream.md b/snippets/automatic-push-upstream.md new file mode 100644 index 000000000..bb676073e --- /dev/null +++ b/snippets/automatic-push-upstream.md @@ -0,0 +1,22 @@ +--- +title: Automate upstream branch creation +tags: configuration,repository +expertise: intermediate +author: chalarangelo +cover: blog_images/violin.jpg +firstSeen: 2022-10-19T05:00:00-04:00 +--- + +Configures the repository to automatically create upstream branches on push. + +- Use `git config --add --bool` to enable automatic upstream branch creation on push. +- You can use the `--global` flag to enable this setting globally. + +```shell +git config [--global] --add --bool +``` + +```shell +git config --global --add --bool +# `git push` will automatically create new branches, if they don't exist +```