I have always been developing a big project in one machine. I use github to do version control. Now, I just got a new machine. I want to develop the project on the new machine. I am wondering what's the best practice.
What I tried is, in the new machine:
git clone https://github.com/softtimur/project.git
In the folder project, i did
git checkout master
which returns
Already on 'master'
Your branch is up-to-date with 'origin/master'.
Then, I wanted to go to a previous version of the files:
git checkout 19b3644
And I got an message:
Note: checking out '19b3664'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 19b3664... m=back to no lazyload and no toModifyBeforeSubmit
My question is not about how to fix detached Head
state. I want to know whether I should create a new branch in this new machine. I don't need to code from 2 machines, I could make the new machine master
, and I don't need to touch the old machine anymore.
I always have trouble in understanding git... Could anyone help?