0

I have some git repositories and when I do git status I don't have the same message

For a first repository I have (sorry in French)

Sur la branche master
Votre branche est à jour avec 'origin/master'.
rien à valider, la copie de travail est propre

And for another one I have

Sur la branche master
rien à valider, la copie de travail est propre

So I thought it was because the distant repository weren't up-to-date but it is. (difference 1)

And more strange for the second I have this behavior:

git commit -am "Commit message"
git status
Sur la branche master
rien à valider, la copie de travail est propre
git push origin master
git status
Sur la branche master
rien à valider, la copie de travail est propre

So, no difference with or without the git push origin master. (difference 2)

Some questions ? Is the difference (2) normal ?

How to know if the distant repository is up-to-date ?

I think that the difference (1) is because I didn't create them in the same way : the first one was clone and I use the command git remote add origin url for the second. Am I right ? Is it better to clone or to add ?

Ccile
  • 187
  • 1
  • 3
  • 12
  • 1
    You need to track the remote branch after adding a remote. Try `git branch --set-upstream master origin/master` – rustyx Aug 09 '17 at 16:28
  • Super it works. I just want to add : I had the message `the option --set-upstream is obsolete and it's better to use --track or --set-upstream-to` (translate from French) – Ccile Aug 10 '17 at 09:15

0 Answers0