zoukankan      html  css  js  c++  java
  • git命令使用步骤

    先安装git.exe 安装的时候不要改路径
    然后cd到C:Program FilesGitusrin目录
    ssh -t ras -C "xxx@xxx.com"
    创建仓库 输入项目名称 取消勾选 "使用Readme文件初始化这个仓库"

    打开本地cmd 切换到项目目录 输入如下命令
    查看本地仓库的状态
    git status
    将本地文件添加到暂存区
    git add .
    提交本地的文件到仓库
    git commit -m project

    设置你的git名称和电子邮箱
    git config --global user.name "dotcoo"
    git config --global user.email "dotcoo@163.com"

    添加本地仓库的远程地址
    git remote add origin https://gitee.com/dotcoo/vue-shop-01.git
    将本地的代码上传到远程仓库
    git push -u origin master


    查看当前状态 工作区是否干净
    git status

    如果是干净的 就操作之后的命令
    如果不是干净的
    git add .
    git commit -m xxx

    检出代码 创建一个新分支 叫做login
    git checkout -b login
    查看当前是哪个分支 login是绿色的
    git branch

    当前实在login分支中

    查看当前分支的状态
    git status
    将今天的代码添加到暂存区中
    git add .
    提交到本地
    git commit -m "完成了登录功能"

    切换到主分支
    git checkout master
    查看分支
    git branch 默认选中了master分支(绿色)
    login分支合并到主分支
    git merge login
    提交到码云中
    git push

    切换到login分支
    git checkout login
    查看分支
    git branch 默认选中了login分支(绿色)
    提交到
    git push -u origin login

    删除远程仓库地址

    git remote rm origin

  • 相关阅读:
    poj 1579(动态规划初探之记忆化搜索)
    hdu 1133(卡特兰数变形)
    CodeForces 625A Guest From the Past
    CodeForces 625D Finals in arithmetic
    CDOJ 1268 Open the lightings
    HDU 4008 Parent and son
    HDU 4044 GeoDefense
    HDU 4169 UVALive 5741 Wealthy Family
    HDU 3452 Bonsai
    HDU 3586 Information Disturbing
  • 原文地址:https://www.cnblogs.com/yangxiaobai123/p/11833877.html
Copyright © 2011-2022 走看看