[Gambas-user] Git
Christof Thalhofer
chrisml at deganius.de
Fri Aug 10 22:19:53 CEST 2018
Am 10.08.2018 um 20:42 schrieb Jussi Lahtinen:
> Occasionally I get this message when trying to update the sources ("git
> pull" and no, I haven't edited the sources):
>
> "Please, commit your changes or stash them before you can merge.
> Aborting"
You have changed any files in the working dir that would be overwritten
by the pull but you have not committed them in the local repository. See
what has been changed by typing:
git status
Git refuses to fetch and merge the changes from the remote repo because
of conflicts.
> And the solution has been "git reset --hard". How to avoid this? Any
> clue why this happens?
You can do:
git stash
This will reset your working dir to the last state which is the same
like the remote. But also it will save your changes to stash (a buffer
you can use for such things: Temporarily move the local changes of the
working dir out of the way).
git status
will show that there are no changes in the working dir any more. They
were moved to stash.
Then you can do
git pull
which will update your local repo by fetching and applying the changes
of the remote repo. And afterwards you can do
git stash apply
which will apply your last changes again to the working dir.
git status
will then show the (uncommitted) changes again.
Alles Gute
Christof Thalhofer
--
Dies ist keine Signatur
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180810/20937162/attachment-0001.sig>
More information about the User
mailing list