github - Git pull origin <branch> overwrites master? -
i have repository on github, aav1
on laptop have 2 branches, 1 called master , 1 called vs12up master branch when software visual studio 2008, vs12up converted visual studio 2012.
on laptop seems fine , pushed new branch github, appears correct.
on desktop tried pull remote branch:
git pull origin vs12up
it wrote changes master branch on desktop, git log shows commits made on vs12up branch, git branch shows master, current branch.
how can revert changes master branch , pull vs12up branch on desktop match repository on laptop?
if git pull
remote branch name, fetch remote branch , merge current local branch. undo that, first have reset local branch remote master
, create new local vs12up
branch corresponding remote branch.
reset local
master
match remote repository'smaster
(warning: sure don't have uncommitted changes want keep before issuing following command):git reset --hard origin/master
fetch remote branches local repository:
git fetch origin
create new local
vsup12
branch remotevsup12
branch, , switch new local branch:git checkout -b vsup12 origin/vsup12
note when subsequently git pull
while switched vsup12
branch, you'll fetch , merge latest changes vsup12
branch on github local vsup12
Comments
Post a Comment