I've been working on the master branch. Now i want to pull all the work to a new branch i just created to continue working there.
Im new on git, and the idea is to work on a branch and just merge it on master until my code pass(im on school). But i already started and had made lots of progress that i dont want to lose.
I already git checkout but it just returns me a blank readme.
From your description I can imagine that you're working on the master branch, but it seems that you haven't added changes and you haven't created any commit ( I guest only ) In that case, you can just create a new branch
git checkout -b new_branch_name
In case you committed your work into commits in master branch and already pushed it to Github (ignore below commands if you haven't), you can back to master branch reverse it
git checkout master
git reset --hard HEAD~HERE_NUMBER_OF_YOUR_NEW_COMMITS
git push origin master -f
git checkout new_branch_name #To continue work on new branch (with all your new works remained)
Then, commit changes ( this should be repeated many times when you have completed sth
git add .
git commit -m "I created new feature"
git push new_branch_name
And then, from Github, you can create a pull request so your tutor / teammate can review
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments