美文网首页
2020-10-27 GitHub 更新项目

2020-10-27 GitHub 更新项目

作者: 赢家黄氏江夏堂联富 | 来源:发表于2020-10-27 00:57 被阅读0次

    几年没更新GitHub了,更新一下...

    https://github.com/englianhu

    洋仔音乐:SHE:波斯猫KTV

    波斯猫mp3免费下载

    First, run a fetch to update all origin/<branch> refs to latest:

    `git fetch --all`

    Backup your current branch:

    `git checkout -b backup-master`

    Then, you have two options:

    `git reset --hard origin/master`

    OR If you are on some other branch:

    `git reset --hard origin/<branch_name>`

    Explanation:

    git fetch downloads the latest from remote without trying to merge or rebase anything.

    Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master

    Maintain current local commits

    [*]: It's worth noting that it is possible to maintain current local commits by creating a branch from master before resetting:

    `git checkout master`

    git branch new-branch-to-save-current-commits

    `git fetch --all`

    `git reset --hard origin/master`

    After this, all of the old commits will be kept in new-branch-to-save-current-commits.

    Uncommitted changes

    Uncommitted changes, however (even staged), will be lost. Make sure to stash and commit anything you need. For that you can run the following:

    `git stash`

    And then to reapply these uncommitted changes:

    `git stash pop`

    How do I force “git pull” to overwrite local files?

    ---

    delete branch locally

    `git branch -d localBranchName`

    delete branch remotely

    `gitpush origin --delete remoteBranchName`

    How to Delete a Git Branch Both Locally and Remotely

    ---

    Just do:

    `git push origin <your_branch_name> --force`

    or if you have a specific repo:

    `git push https://git.... --force`

    This will delete your previous commit(s) and push your current one.

    It may not be proper, but if anyone stumbles upon this page, thought they might want a simple solution...

    Short flag

    Also note that -f is short for --force, so

    `git push origin <your_branch_name> -f`

    will also work.

    How do I properly force a Git push?

    相关文章

      网友评论

          本文标题:2020-10-27 GitHub 更新项目

          本文链接:https://www.haomeiwen.com/subject/rdhtvktx.html