문제

Say I have a command that looks as follows:

git checkout -b my-branch origin/dev

Assuming I have already fetched from origin before, so I know it has a dev branch, do I need to run git fetch before git checkout, or will checkout always fetch up to the latest commit in the remote branch?

도움이 되었습니까?

해결책

git checkout -b branch origin/branch will check out from the remote repository without fetching the repository. The checked out branch will be what the branch looks like on the remote repo.

Note: Your local repository will not have the updated knowledge of the remote repository, so git branch -a may not show the remote branch you are checking out or it may show an older reference to it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top