Tech Junkie Blog - Real World Tutorials, Happy Coding!: git & github: Create A New Branch

Tuesday, September 3, 2019

git & github: Create A New Branch

In previous posts we created a new git repository locally and on github and then sync them up.  In this post we are going to create a new branch in the local git repository and push it to the remote repository.


First let's create a new branch with the following command in the local git repository

git checkout -b "Hour2"








Now following the tutorials in this post Hour 2: Enable ASP.NET Core to Serve Static Files

After you are done open the command line in the folder and type git add .



































Then you just commit the new code like normal.














The final step is we need to push the new branch and code into the remote repository with this command git push -u origin Hour2
















Now if you log into github you will see that new branch and the code has been pushed to the remote repository

Previous: git & github: Sync Your Local Repository With A github Repository

No comments:

Post a Comment

Search This Blog