Lesson for git checkout remote

Jiang Wang
1 min readNov 21, 2020

I used git some years ago and then was forced to use another version control software. Now I need to use git again. One lesson I learned new is that git checkout remote does not actually get the latest change from the remote repository. Well, this may be obvious for many people, but I learned it in a hard way.

Basically, I tried this command :

git checkout -b myfeature remotes/origin/theirs

I thought that means it will also give me the latest change on remotes/origin/theirs, but it turns out not. I still need to use git fetch and git pull to get the latest changes from the remote.

I think the confusing part is that the remote shows up in the command, but that does not mean the latest remote.

Some references:

--

--

Jiang Wang
0 Followers

Interested in Linux kernel, information security, networking and virtualization.