I use jira at work, I will always have to create a branch in jira the in my terminal I do 2 steps
- git fetch origin feature/myticket-id
- git checkout origin feature/myticket-id
How can I use only single command, checkout the new branch without fetch?
I use jira at work, I will always have to create a branch in jira the in my terminal I do 2 steps
How can I use only single command, checkout the new branch without fetch?
You need to fetch something before being able to checkout it locally.
Since there is no native command to do both in one operation, you would need an alias, as mentioned in "fetch and checkout a remote git branch in just one command"
[alias]
fetch-checkout = !sh -c 'git fetch $1 $2 && git checkout $2' -
Used as:
git fetch-checkout feature/myticket-id