0

Let's say I have my main branch in GitHub. Me and my friend want to make a second branch called testing where we can mess around with other code before merging it to the main branch. How can I add code to this testing branch. For example, lets say there is an HTML page in the testing branch and the main branch. How can I make changes to the one in the testing branch without touching the one in the main?

I saw slightly similar questions like Github push changes to someone else's branch but that did not help me.

I am using windows if that makes a difference.

The_Redhawk
  • 214
  • 1
  • 2
  • 11

1 Answers1

0

The proper way to do that is to pull the code to your local machine, make changes and push back to the remotes repository new branch.

git pull Get code from GitHub repository to your local machine

git checkout -b testing Switch to new branch. Make changes in your files here

git commit -a -m "Some feature" Commit changes to your testing branch

git push --set-upstream origin testing Push changes to GitHub to the new branch called "testing"

Mike
  • 519
  • 1
  • 4
  • 10