in Technology by
How can we create a new branch on both local and remote?

1 Answer

0 votes
by

First, you create your branch locally:

git checkout -b <branch-name>

The remote branch is automatically created when you push it to the remote server. So when you feel ready for it, you can just do:

git push <remote-name> <branch-name>

Where <remote-name> is typically origin, the name which git gives to the remote you cloned from. Your colleagues would then just pull that branch, and it's automatically created locally

Related questions

0 votes
    How to push a new local branch to a remote Git repository and track it too?...
asked Jan 7, 2021 in Technology by JackTerrance
0 votes
    How can we create a remote Git branch?...
asked Jan 8, 2021 in Technology by JackTerrance
0 votes
    How to Reset local repository branch to be just like remote repository HEAD?...
asked Jan 7, 2021 in Technology by JackTerrance
0 votes
    How can we check out a remote Git branch?...
asked Jan 7, 2021 in Technology by JackTerrance
0 votes
    How can we rename a local Git branch?...
asked Jan 7, 2021 in Technology by JackTerrance
0 votes
    I created a local branch that I want to 'push' upstream. There is a similar question here on Stack ... the upstream repository? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Create a new Pull request. Review the changes between master and starfeature branch, and confirm by clicking Create ... . Stakeholders C. Starprojectteam D. None of the options...
asked Dec 23, 2022 in Technology by JackTerrance
0 votes
    Which of these class is used to create servers that listen for either local or remote client programs? (a ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these class is used to create servers that listen for either local or remote client programs? (a ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    How can we stash only one of multiple changed files on my branch?...
asked Jan 8, 2021 in Technology by JackTerrance
0 votes
    How to rename and remove branch in remote Git?...
asked Aug 24, 2021 in Technology by JackTerrance
0 votes
    I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitHub, ... those forks I pulled? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    My git workspace is dirty, there are some local modifications. When I use the command git pull origin master it ... Ansible git module? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I don't want to rename a remote branch, as described in the Rename master branch for both local and remote ... and remote branch name Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Which command can you use to update remote refs with local refs? A. git push B. git fetch C. git pull D. git update...
asked Dec 17, 2022 in Technology by JackTerrance
...