I've been doing development work in a 'dev-test' directory and committed files along the way. I now need to commit those same files to a differently named directory and remove the committed files in the 'dev-test' directory. I'm not sure how to retain my working files.
My 'dev-test' repo is local, but I have been doing pulls that are tracking as 'master', but I have not merged my code.
Can I use git reset before my first commit of these files as other developers have been merging into 'master':
git reset --soft #commitID
Your question is still a bit unclear, but you probably want one of these:
Just move the files if they aren't modifications to some other files
$ git mv dev-test/files other-dir
$ git commit -a
If your test files are modifications to other files, you would want to get a diff
of your work from when you started it until now and apply the patch to the other directory.
In case what you wanted was the second, you should have in fact done a different thing from the start. If you want to test something and then later apply it to master, you should create a branch, work on it and if you are satisfied, merge master into your branch. If everything was fine, then you can merge everything back to master and have everyone know about it.
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