Login  Register

Re: Using git

Posted by LordOfBikes on Nov 28, 2017; 8:55pm
URL: https://forum.librecad.org/Using-git-tp5715509p5715510.html

If you haven't added the modification to the index yet, you can do a checkout to revert changes.

Use
git status
to see if any files are added to commit.
Or use
git diff
If you see diffs, the modifications are not added to the index yet.
With
git diff --cached
you can also check if there are any files to be committed in the index.

So when the index is empty, there is no output with
git diff --cached
then use this:
git checkout master
git pull

When you have modifications in the index, you have to reset your repo this way:
git reset --hard
git pull
This will revert the modifications in the working tree and also reset the index.

You may also have a look at these resources:
git tutorial: http://www-cs-students.stanford.edu/~blynn/gitmagic/
git reference: https://git-scm.com/docs
investing less than half an hour into Search function can save hours or days of waiting for a solution