I have recently changed my programming machine, which is leading to some startup issues in getting my new coding source to integrate seamlessly with my existing Github repo and my app on Heroku.
I originally used git clone
to clone the Github repo onto my new machine. Since then, something has happened.
git add .
, git commit -m "mychanges"
, and git push
, the code gets sent straight to Heroku. It used to get sent to my own Github repo, but I understand that's a simple matter of redefining what is considered 'origin'.git push origin master
, I get the following error:I am concerned that my last two days of coding will be lost if I do a git pull
(I have backed everything up just in case).
My current idea: do the git pull
and manually update the last two days' files from my backup, then finally do my git push
. Is this the right way to go, or is there a more elegant solution?
git will not overwrite your data unless you use reset. git pull
will take the commits on origin/master
(assuming your branch is master) and try to fast-forward your local branch to that point, merging any local changes. If you've committed locally, and those commits are meant to go after any more recent commits on the server, you can do git pull --rebase
instead.
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