This is probably quite simple but I’m currently a git noob and haven’t quite got my head round the git branching model yet.
Suppose I currently have no branches other than master, but now I’ve made some changes since my last commit that I’ve decided I don’t want to keep (note: the changes are not committed yet). I don’t want to get rid of these changes just yet though – I’d like to put them in their own branch (called e.g. experimental_stuff) and then continue development from my previous commit. So I guess the steps are:
- make current master a branch (
git branch experimental_stuff?) - go back to previous commit (
git checkout <last_commit>?) - make this my new master branch so that future commits continue from here (
git ????)
Is this the right approach and what git command do I need for the last part (if any) ?
[Note: this is just a local git repository for my sole use, if that make any difference.]
you are almost done.
Assume you have made a commit on your development files. Then..
Assume you have not made a commit on your development files. Then..
you need to save your current changes to a temporary directory