zoukankan      html  css  js  c++  java
  • Git学习笔记 --第一章

    本系列学习笔记参考廖雪峰Git教程

     安装Git

     Linux平台

    Ubuntu/Debian命令:sudo apt-get install git

    其他版本  Git官网下载源码,然后解压,依次输入:./configmakesudo make install

     Win

    https://git-for-windows.github.io/安装即可

      设置

     git config --global user.name "Your Name"

    git config --global user.email "email@example.com"

      创建版本库

    选择合适的地方建一个文件夹

    $ mkdir git  

    $ cd git

    $ pwd  //显示当前目录

    /Users/my/git

      把文件添加到版本库

    在gitb目录新建一个文件,如readme.txt

    This is my first Git test

    然后执行命令

    git add readme.txt

    git commit -m "wrote a readme file"  //commit一次可提交多个文件

    小结:

    初始化一个Git仓库,使用git init命令。

    添加文件到Git仓库,分两步:

    • 第一步,使用命令git add <file>,注意,可反复多次使用,添加多个文件;

    • 第二步,使用命令git commit,完成。

     

     

     

  • 相关阅读:
    复习一些奇怪的题目
    NOIP 考前 KMP练习
    NOIP 考前 并查集复习
    NOIP 考前 Tarjan复习
    NOIP 考前 图论练习
    BZOJ 1468 树分治
    Codeforces Round #376 (Div. 2)
    CodeVS 线段覆盖1~5
    Luogu 3396 权值分块
    BZOJ 2743 树状数组
  • 原文地址:https://www.cnblogs.com/battleblock/p/4808244.html
Copyright © 2011-2022 走看看