Since I am new to Git, I have some trouble getting started (Git version 2.12.3).
I created on a server a file (in GitLab) which I can clone to a local directory.
git clone [email protected]:/joe/myproject.git
All fine, and I have a local copy of the file. But when I change remote something to the file (from someone else or on the server), then I am not able to track or to see the changes on the local client, even if they are clearly visible on the master. Not with
git diff file1
or
git diff origin/master
or something else.
I have to fetch the file, merge it, and then I am able to see the newly edited content. Is it possible to observe and detect the new changes before fetching the new file?
I would do it like this:
git fetch origin master
And then I would do:
git diff master origin/master
In a more simplified way, to see the difference in your local and remote repository, the syntax would be like this:
git diff <masterbranch> <remotebranch>
There is also git difftool
command which shows the difference in a UI environment if you have installed one, I have rarely used this, so it's kind of an uncharted area for me. Have fun.
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