Git Pull request the branch name -
i have problem command "git pull". have 2 stash users , in 1 user works fine , in other gives error message saying: asked me pull without telling me branch want merge with. please specify branch want use on command line , try again (e.g. 'git pull '). see git-pull(1) details.
i spotted problem dont know how fix it. when checkout branch not writing .git/config file. however, happening when create branch, when others create branches can access them , written in .git/config file.
why happening? thanks,
it's user problem has branch checked out locally, not tracking remote branch. can fix following:
git branch --set-upstream branchname origin/branchname
it possible local branch created user before remote branch existed — or before git fetch
found it. (this because git checkout branchname
has different behaviour depending on whether remote branch same name found.)
an alternative approach delete local branch , re-checkout remote:
git branch -d branchname git checkout branchname
the newly checked-out branch tracking remote branch origin/branchname
.
if you're paranoid losing local changes, can make sure don't lose them creating new branch before delete old one:
git branch branchname_backup branchname
as always, highly recommend tig better understanding of branches doing.
Comments
Post a Comment