search

Home  >  Q&A  >  body text

Git remote warehouse problem (commit. rollback)

1. I cloned a project from the master branch to the local one.
Now I have forked a repository.
How to submit the locally modified code to the forked remote repository
instead of the first cloned one? Where is the warehouse

2. How to roll back version of remote fork warehouse

習慣沉默習慣沉默2845 days ago821

reply all(2)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-02 09:43:07

    1. For information about synchronizing git to fork warehouse, please refer to: Git synchronizes original warehouse to fork warehouse

    2. To return the version, you can use the following command:

    git reset --hard HEAD~3#3指的是退回到最近的第几次提交,是倒数的

    or:

    git reset --hard 对于版本的哈希值

    For details, see: Liao Xuefeng Git Tutorial: Version Rollback

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-02 09:43:07

    Submit to remote repository:

    • First establish a connection between the local warehouse and the remote one, git remote add origin "the address of the remote warehouse", and then the common commands for submission: git add *; git commit -m "Add remarks"; git push origin master; That's it.

    Version rollback:

    • First use git log to check the submitted version history and find the version number of the version you want to roll back;

    • Then, execute the command git reset --hard "version number"

    reply
    0
  • Cancelreply