How do you create a remote Git branch?

后端 未结 23 1913
感情败类
感情败类 2020-11-22 13:31

I created a local branch which I want to \'push\' upstream. There is a similar question here on Stack Overflow on how to track a newly created remote branch.

Howeve

23条回答
  •  孤街浪徒
    2020-11-22 14:14

    I use this and it is pretty handy:

    git config --global alias.mkdir '!git checkout -b $1; git status; git push -u origin $1; exit;'
    

    Usage: git mkdir NEW_BRANCH

    You don't even need git status; maybe, I just want to make sure everything is going well...

    You can have BOTH the LOCAL and REMOTE branch with a single command.

提交回复
热议问题