zoukankan      html  css  js  c++  java
  • git基本命令使用

    一,注册Github账号

    1.先注册一个账号,注册地址:https://github.com/

    2.登录后,开始你的旅程

    3.创建一个repository name,输入框随便取一个名字(不要用中文)

    4.点Create repository创建成功,界面如下

    二、clone代码

    1.把别人的代码clone到本地,或者clone自己github上的代码,使用指令

    >git clone https://github.com/pancakefans/AutoTest1.git

    2.在本地随便新建个文件夹,地址栏输入cmd打开,然后输入上面指令

    三、更新代码

    1.在AutoTest1文件夹下更新东西,比如我上传1个资料文件

    2.更新后使用git add * (*是更新全部)

    >git add *使用 git add 命令将想要快照的内容写入缓存区

    3.接着输入git commit -m "更新说明“,使用 git commit命令则将缓存区内容添加到仓库中

    >git commit -m "更新说明“

    4.如果是多人同时开发维护代码,得先git pull ,拉取当前分支最新代码

    >git pull

    5.最后git push origin master,最后一步才是push到远程的master分支上

    6.打开github界面就能看到同步了

    四、其他的命令

    1.查看远程分支  git branch -a 

    2.新建分支  git checkout -b 分支名

    3.同步分支 git merge

  • 相关阅读:
    MySQL "show users"
    MySQL
    A MySQL 'create table' syntax example
    MySQL backup
    MySQL show status
    Tomcat, pathinfo, and servlets
    Servlet forward example
    Servlet redirect example
    Java servlet example
    How to forward from one JSP to another JSP
  • 原文地址:https://www.cnblogs.com/heyuling/p/12066293.html
Copyright © 2011-2022 走看看