Git - making a working directory a master -
i have git working directory use create new master, keeping existing commit history (etc.) intact. reason original remote master has become corrupt, , working directory has had updates made since.
i've tried git clone of working directory, unable push cloned directory. similar problem if straight copy , paste of working directory git server.
how convert local working directory new master on remote server?
i'm newbie when comes git, simple explanation without jargon helpful.
i guess getting error cannot push remote repo because branch whatever checked out (like here: git push receiving "error: refusing update checked out branch").
to create bare repo (this repo full history without checked out working copy),
git clone --bare yourrepo barerepo.git
then, take barerepo.git
directory , move machine should host it.
one done, add repo remote yourrepo
git remote add origin /path/to/barerepo.git
then, should able to
git fetch origin git push origin
however, question sounds want restore crashed remote repository local one. had same issue 1 week ago: how restore remote crashed git repo?
Comments
Post a Comment