Open brylie opened 9 years ago
:+1:
Yes, I have the same problem ! - I'm pretty sure this used to work flawlessly about 6 month ago .. !? My remote branches says : "origin/xxxxx" -- trying to checkout it becomes "origin/xxxxx" as a local branch, but doesn't work or track the remote. Even setting "branch.default=current" breaks ?
Hey all, I added the --track flag in a pull request. Please test and let me know if it works for you.
The --track, or -t, flag was the recommended solution as per the following sources:
As a convenience, --track without -b implies branch creation
If no -b option is given, the name of the new branch will be derived from the remote-tracking branch https://git-scm.com/docs/git-checkout
So, the basic command for checking out a remote branch and setting up tracking seems to be:
git checkout --track remote/branch
User story
As a developer When I clone a remote branch I expect it to automatically enable remote tracking and pull the remote changes so that I can start working on and committing to the remote branch as simply as possible
Observed behavior
When I click on a remote branch that does not exist locally, a new local branch is created, but the local filesystem does not match the remote filesystem. Also, the local branch does not seem to be tracking the remote branch.
Expected behavior
When clicking a remote branch, a new local branch of the same name would be created. The locak branch will be set to track the remote branch, and all files/changes in the remote branch will be pulled into the newly created local branch.