Git for version controlling Android project
For some mysterious reasons, I ended up deleting my local repository. I now cloned my remote repo back into my Eclipse workspace and it shows that I am working on the master branch of my Android project rather than the local repo and it makes sense.
The reason why I started using Git is so that I can make wild changes to the project and if anything breaks, I can go back to the last stable state. Now, with a local repo gone and me working straight on my master branch of the project, I do not know how that can be done.
Please tell me how that can be done.
PS: I need to have Android project in my workspace or else Eclipse starts complaining cause it cannot find user libraries
2 Solutions collect form web for “Git for version controlling Android project”
If you cloned the remote repo back into your workspace, you have a local repo once more.
And you can always create new branches for your wild changes instead of working directly on the master branch.
You can make brach say masterbranch and dev barch : master brach means most stable code is in , dev brach means after any changes u willing to take backup u can push to dev brach and dont push to master until and unless u r sure of it.
Create local brach
git checkout -b your_branch
Push it to the remote server.
git push <remote-name> <branch-name>