jacogr / atom-git-control

Not maintained :(
MIT License
227 stars 70 forks source link

Repository not tracking remote origin when creating new local branch based on existing remote branch #109

Open brylie opened 9 years ago

brylie commented 9 years ago

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.

sylvainlap commented 9 years ago

:+1:

frese commented 9 years ago

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 ?

brylie commented 9 years ago

Hey all, I added the --track flag in a pull request. Please test and let me know if it works for you.

brylie commented 9 years ago

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