0

I ran a 'git status' on a folder and it replied:

$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean

However, running a git log failed to show the latest update that I know is there:

* e2f5a0b (HEAD -> master, origin/master, origin/HEAD) First version of all
* f11f989 Initial commit

so I ran 'git pull' and it brought down all updates:

* 057c274 (HEAD -> master, origin/master, origin/HEAD) update for ginger
* e2f5a0b First version of all
* f11f989 Initial commit

Have I failed to understand something with git? Is it because Git status only works on the current folder - all my updates were in a sub-directory?

Note, the only thing I can see and this might just be a red-herring, is when I look on the web server (I'm using gitlab) I can see the update but on trying to view file history it tells me all the files that have changed but fails to show a diff on them (I did read diff has issues with utf16 but that wouldn't explain this fault?)

thanks for any help.

[EDIT]Note, when I look in the history, it says 'binary files differ', but these are all .SQL text files saved simply by ssms.

Neil Walker
  • 6,400
  • 14
  • 57
  • 86

1 Answers1

5

status shows the status of your local repository. It does not communicate with your remote.

pull performs two actions. First fetch, which contacts the remote to download new content: that's where the new commit comes from. Then merge, which is irrelevant here.

Bottom line: git fetch before any remote-related query.

Quentin
  • 62,093
  • 7
  • 131
  • 191
  • ah, sorry, I thought somehow it might check the server ;) maybe I should delete this question and ask another regarding thinking my sql is binary? – Neil Walker Oct 01 '19 at 15:15
  • @NeilWalker I'm pretty sure that's a solved problem already, a quick search brought [this](https://stackoverflow.com/questions/777949/can-i-make-git-recognize-a-utf-16-file-as-text) up which seems relevant. – Quentin Oct 01 '19 at 15:17
  • thanks. It's gitlab showing this issue too as well as 'git for windows gui' and cygwin. I wonder if there's a way to get ssms to conver to utf8... – Neil Walker Oct 01 '19 at 15:18
  • the problem is ssms is saving as utf8, but when you script as, it saves as utf16 – Neil Walker Oct 01 '19 at 15:47