
Since we are already inside the dev branch, any commit that we do will happen only on the dev branch. # vim index.htmlĬommit the change to the dev branch. In this example, let us make a change to index.html file. Any change that you do from now on will be only on the “dev” branch. Now that we have a new “dev” branch, start making your changes here. The following git status command indicates that we are currently on the new “dev” branch. # git branch -aĪs you see from the above output, the * is now in front of dev, which indicates the current working branch is dev. Verify that the new branch got created as shown below.

# git clone By default, the current working branch is master branch. In the following example, I’ve cloned demoproject from remote git repository to work on it locally. # Finally, delete dev branch both locally and remoteįor explanation and example output of the above steps, read the rest of the article. Git commit -m "Made the change." index.html Git clone # Create new dev branch, do your work, and commit changes locally
#Git create new branch and move changes code#
For the impatient, here is the code snippet for the above steps: # Clone the git repo:
