Use git to test

17 November, 2019
Back

Some times you need a blank sheet of paper to sketch out an idea before commiting to it.

Use git branch test-branch to duplicate the branch you're currently working on and try out new code. git add . and git commit -m "changes" to save your work.

If you're happy with the changes, go back to the master branch git checkout master and implement your changes git merge test-branch.

If you don't like it, git branch -d test-branch to scratch it.

Don't worry, you can always start again. That way, you don't have to use your main project in the master branch to try things out.


Back