git create new branch
// Example for creating a new branch named myNewBranch
git checkout -b myNewBranch
// First Push
git push --set-upstream origin myNewBranch
git create new branch
// Example for creating a new branch named myNewBranch
git checkout -b myNewBranch
// First Push
git push --set-upstream origin myNewBranch
git command to create a branch
//Create a New Branch
git checkout -b [name_of_your_new_branch]
//First Push
git push --set-upstream origin [name_of_your_new_branch]
how to create new branch
How to create a new branch in git
$ git checkout -b good
here good is new branch name
the line 3 after executing we will go to that branch
create new branch git from master
git checkout -b new-branch-name
how to create a new branch
- git branch xyz ==>
it creates new branch named 'xyz' but still keep being on master branch
- git checkout xyz ==>
it will change your branch to the develop branch
- git checkout -b xyz ==>
it creates also a branch named xyz and switches to it automatically
git create master branch in empty repository
# initialize your bare repo
$ git init --bare test-repo.git
# clone it and cd to the clone's root directory
$ git clone test-repo.git/ test-clone
Cloning into 'test-clone'...
warning: You appear to have cloned an empty repository.
done.
$ cd test-clone
# make an initial commit in the clone
$ touch README.md
$ git add .
$ git commit -m "add README"
[master (root-commit) 65aab0e] add README
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README.md
# push to origin (i.e. your bare repo)
$ git push origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 219 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /Users/jubobs/test-repo.git/
* [new branch] master -> master
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us