• git杂记-远程仓库的使用


    1. 查看远程仓库;克隆自己的仓库,如不命名则默认远程仓库名字为origin;
      $ git clone https://github.com/OuFeng/JF_WEB.git
      Cloning into 'ticgit'...
      remote: Reusing existing pack: 1857, done.
      remote: Total 1857 (delta 0), reused 0 (delta 0)
      Receiving objects: 100% (1857/1857), 374.35 KiB | 268.00 KiB/s, done.
      Resolving deltas: 100% (772/772), done.
      Checking connectivity... done.
      $ cd ticgit
      $ git remote -v         --查看本地仓库中对应有哪些远程仓库;如果远程仓库不止有一个的话,则会列出多个仓库。

        origin https://github.com/OuFeng/JF_WEB.git (fetch)
        origin https://github.com/OuFeng/JF_WEB.git (push)

    2. 添加远程仓库;名称为pb。
      $ git remote
      origin
      $ git remote add pb https://github.com/paulboone/ticgit
      $ git remote -v
      origin    https://github.com/schacon/ticgit (fetch)
      origin    https://github.com/schacon/ticgit (push)
      pb    https://github.com/paulboone/ticgit (fetch)
      pb    https://github.com/paulboone/ticgit (push)
    3. 从远程仓库抓取与拉取。
      --抓取origin远程库的所有分支;只抓取数据,并不自动合并;
      $ git fetch origin
      --拉取origin远程库的所有分支;只抓取数据,自动合并;
      $ git pull origin
    4. 推送到远程仓库;推送到origin仓库的master分支;
      $ git push origin master
    5. 查看远程仓库,查看origin仓库的更多信息
      $ git remote show origin
    6. 远程仓库的重命名和删除
      --把远程仓库pb重命名为paul
      $ git remote rename pb paul
      
      
      --删除paul远程分支的引用
      $ git remote rm paul
  • 相关阅读:
    01-移动端 REM 适配(postcss-pxtorem,lib-flexible的使用)
    19-webpack性能优化集锦
    10-map/WeakMap/WeakSet的使用场景
    03-web worker vue项目实战
    ELFhash
    哈希查找
    Logger之Logger.getLogger(CLass)使用(转载)
    mybatis中多对一查询
    IDEA中无法打开查看log文件解决方案
    Self-Supervised Scene De-occlusion(转载)
  • 原文地址:https://www.cnblogs.com/oufeng/p/6662931.html
Copyright © 2020-2023  润新知