I'm having a rather annoying issue that is likely a simple problem to fix, though I cannot find any solution on google to it.
I'm currently working on an assignment that requires me to switch between branches that are "checkpoint" based work and "assignment" based. Basically what's happening is every time I push something to Github, the local files in the folder I'm working on seem to...disappear and I don't know why. I have to recreate the files and copy/paste code into it every time and it is driving me insane. Here is what I have been doing at the end of either completing a checkpoint or assignment;
git add .
git commit -m ""
git push origin "checkpoint name"
git checkout master
And after that's done, the files in my work folder are no longer in my local for some reason and I can't figure this out.
The problem is that the last command switches the branch to master and since the changes are not merged to master the changes are not visible in the master branch.
What is suggested is not to execute the last command git checkout master and continue working and once all the changes are done, then merge with master.
Look into the tutorial for more details https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With