Sync local git repo with remote in one shot discarding local changes/commits

后端 未结 3 460
一生所求
一生所求 2021-01-31 06:50

I\'m a not a git expert so this might look like a silly question.

I have local and remote repositories, I want to sync my local with the remote repository. I have many l

3条回答
  •  盖世英雄少女心
    2021-01-31 07:08

    The permanent fix if you always want to create a new branch on the remote to mirror and track your local branch(or vice-versa) is:

    git config --global push.default current
    

    I always configure my local git with this command after I do git clone. Although it can be applied anytime when the local-remote branch "Git fatal: The current branch has no upstream branch" error occurs.

    Hope this helps. Much peace. :)

提交回复
热议问题