美文网首页
windows下gitHub笔记!

windows下gitHub笔记!

作者: DragonersLi | 来源:发表于2017-07-02 00:38 被阅读13次

    https://github.com/ 注册账号登陆!
    https://desktop.github.com/ 软件下载地址!
    https://www.git-scm.com/download/win Windows下载Git地址!

    GitHub:

    Paste_Image.png
    安装完成后,桌面鼠标右击,菜单会出现如下图:
    Paste_Image.png
    新建项目文件夹进入后鼠标右击,选 Git Bash Here !进入命令行,输入如下两行命令配置用户名和邮箱。
    Paste_Image.png
    
    //获取配置列表
    git config --list
    
    //配置用户名
    git config --global user.name 'DiorsCoder'
    
    //配置邮箱
    git config --global user.email '865196792@qq.com'
    
    //创建项目目录并进入
    mkdir  dirName
    cd  dirName
    
    //git控制
    git init  
    
    
    Paste_Image.png
    Paste_Image.png
    使用Git添加文件到暂存区,可以使用linux命令也可以windows界面操作!
    //创建,编辑,查看文件内容
    touch  fileName
    vim fileName
    cat fileName
    
    //查看状态
    git status
    
    //添加 & 修改:先添加或修改本地文件,再提交到 Git 暂存区 ,最后提交! 
      
    git add fileName 
    git commit -m ‘备注’  
    git push
    
    //删除文件步骤:
    rm fileName 
    git rm fileName
    git commit  -m ‘备注’
    git push
    
    //删除文件夹步骤:
    rm -rf dirName
    git rm -rf dirName
    git commit(文件写入备注)
    git push
    

    一.添加文件到暂存区:


    Paste_Image.png

    二.提交文件到版本库


    Paste_Image.png

    从 GitHub 上 复制仓库地址,在本地 使用命令:git clone https://github.com/GitHub账户/项目名.git ,把项目克隆至本地。

    Paste_Image.png Paste_Image.png
    //查看所有分支
     git branch -a
    
    //切换分支
    git checkout 分支名称
    
    //合并其它分支代码
    git merge 其它分支名称
    
    //查看日志
    git log
    
    //更新仓库最新代码至本地
    git pull
    
    
     
    
     
     
    

    登录GitHub新建仓库:账户名.github.io,新建html文件:index.html。例如:DiorsCoder.github.io

    Paste_Image.png
    然后浏览器输入访问:https://账户名.github.io
    例如:https://diorscoder.github.io

    相关文章

      网友评论

          本文标题:windows下gitHub笔记!

          本文链接:https://www.haomeiwen.com/subject/jqufottx.html