

This should create a new branch namely “hello-git-branch”. Go to the Git Bash and write this command for creating a new branch based on the master branch: You can see, the local repo now contains both files that we have in the remote repository (on Github website).įinally, we reached the topic for what you are here “how to create a new branch”. See the graphics below what this command resulted: This command should pull all files from the “master” branch in the remote repo into your local repo. Use this command to pull files from the remote repository: You have to change the URL as per your repo.Īfter executing this command in Git Bash, this should show no message. You have to specify the path that you may get from Github website as shown below: Now run this command for synchronizing your remote repository with local. Now, if you look at the folder, it should show. First, we will synchronize the Github repository with the local repository.įirst of all, run the following command on Git Bash: Until now, our local folder contains nothing. Step 3: pull Github repo into the local machine This should open the command line prompt for the Git Bash where you may write commands to work with this version control system. Open that folder and right click on it and press “Git Bash Here” option as shown below. For the demo, I used E drive and created a folder “git-local”. Now go to the directory where you want to create a local repository.
#Github new branch install
If you have not done so, you may install it by visiting this website and download/install it on your machine.
#Github new branch software
I have installed Git software on windows machines with Git Bash.
#Github new branch how to
However, for learning how to create branches by command-line, we will create a new branch based on master branch. Note: If you look at the above graphics (after creating a repo), it shows the master branch is already created. Our repository now contains two files as shown below: If you check the “Initialize this repository with README” option then the new repo should contain a file “README.md”.įor branch testing, let us create a file in this repository so that we can see later what a branch contains.įor the demo, I have created ‘file-1’ and just a line of text.
