zoukankan      html  css  js  c++  java
  • Git相关操作四

    1.克隆远程仓库

    git clone remote_location clone_name

    remote_location为仓库地址,clone_name为要克隆到本地的仓库名称。

    2.显示对应克隆地址

    git remote -v

    3.查看远程仓库是否更改,并拉取远程仓

    git fetch

    远程仓并不是直接merge到本地分支上,而是在一个远程分支上。想要同步到本地需要用到4命令。

    4.将远程仓的修改合并到本地master分支上

    git merge origin/master

    5.将本地仓库推到远程仓库上

    git push origin your_branch_name

    在git add和git commit之后执行,可以将本地的仓库推到远程仓库上。your_branch_name为分支名称。

    6.git pull和git fetch区别

    当你位于master里,git pull命令等于git fetch origin,然后git merge origin/master

    当你位于branch里,git pull命令等于git fetch origin,然后git merge origin/branch

  • 相关阅读:
    git学习
    Command Line
    python之测试
    python之模块
    python之函数
    python之类
    python之错误和异常
    python之迭代器和生成器
    python之字典和集合
    python之列表和元组
  • 原文地址:https://www.cnblogs.com/FZfangzheng/p/7666941.html
Copyright © 2011-2022 走看看