Skip to content

Create new branch using CLI? #2863

Answered by mislav
JakeMalis asked this question in Q&A
Jan 27, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi, welcome to GitHub!

GitHub CLI provides only some functionality to look up information from GitHub, such as issues and pull request, but a lot of operations regarding version control (such as managing branches) are best made using git proper.

Therefore, to create a new branch, you would use git:

git switch --create my-feature

Later, when you make some commits on that branch, you can either push the branch to a remote repository:

git push -u origin my-feature

or you can choose to submit a pull request using GitHub CLI:

gh pr create

For more information, see https://docs.github.com/en/github/using-git

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JakeMalis
Comment options

@mislav
Comment options

Answer selected by JakeMalis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants