![]() It is possible to defeat this as well (using manipulation), but you're probably better off just being disciplined enough to not create or modify master locally. To delete your remote-tracking branch locally using the command line interface: git branch -d -r origin/masterīut again, it will just come back on re-synchronizations. You can do this by deleting the remote-tracking branch locally, but it will simply come back every time you ask your git to synchronize your local repository with the remote repository, because your git asks their git "what branches do you have" and it says "I have master" so your git (re)creates origin/master for you, so that your repository has what theirs has. Your local branch is now an exact copy (commits and all) of the remote branch. git fetch origin git reset -hard origin/master git clean -f -d. git branch local git checkout local Now you are on local branch.Do your changes here and lastly merge it master as: git merge local or else directly move it your required remote. ![]() ![]() The command: Remember to replace origin and master with the remote and branch that you want to synchronize with. I think (based on your comments) that I understand what you want to do: you want your local copy of the repository to have neither the ordinary local branch master, nor the remote-tracking branch origin/master, even though the repository you cloned-the github one-has a local branch master that you do not want deleted from the github version. Reset and sync local repository with remote branch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |