0
When I need to update the local repository, I usually run the command git pull
or git pull origin/branch
.
The git pull origin/branch
as far as I understand "pull" what you have on the remote branch (the origin
indicates the remote repository), now I saw that also works the syntax git origin branch
and I didn’t understand the difference.
It looks like they both update the local repository with the contents of the remote branch, but why does it have this variation?
They do the same thing?
I think it refers to syntax, because one has
/
and the other not? One command is writtengit pull origin/branch
and the othergit pull origin branch
pq?– hugocsl
Got it, I particularly only knew the command
git pull origin branch
, had never tried to usegit pull origin/branch
, I was tested now out of curiosity and returns thatorigin/branch
is not a git repository.– Marcelo Ivanofre
branch has to be the branch name
– hugocsl
Yes, I set branch because it could be any name, but the command I specifically tested was
git pull origin/master
– Marcelo Ivanofre
@Marceloivanofre the doubt was exactly what @hugcsl commented, the difference between the two, because for me there is no mistake, and I noticed that the same happens with the
git reset origin master
andgit reset origin/master
– Ricardo Pontual
@Ricardopunctual Look, I was curious about the subject and I found this link of another answer https://stackoverflow.com/questions/2883840/differences-between-git-pull-origin-master-git-pull-origin-master, he answers your question, if you read the comments of the answer you will realize that
git pull origin/branch
became an invalid command from certain versions of git. I hope I helped.– Marcelo Ivanofre
will that be it? I use that application "Git Cmd" for windows, I will update or use another to test
– Ricardo Pontual