GitHub: Creating a branch to trial your own changes

The benefit of this is if you have multiple tasks to do on the code, it allows you to isolate the changes caused by each task. Then you can perform in parallel various tasks wihtout them interfering with each other/ not be pressured to finish tasks at risk of other parts of the project breaking.

Instructions

Firstly must select the right branch that you want to work off.

Create a new offshoot branch in the dropdown.

Now in the Linux terminal:

1 git fetch --all

This…

does what?

Now, need to switch local files to contain the new branch:

1 git checkout <name_of_new_branch>

Check to see that the contents of the new branch contain waht you expect them to:

1 git status

Finally you can check what difference there is with the master branch:

1 git diff -r upstream/<name_of_copied_branch>

If it has just been created, there will be no output (i.e. no differences).