zoukankan      html  css  js  c++  java
  • GIT的理解和简单操作

    轻量级的branch操作是git的一个根本特色。因为其他的版本管理工具是满足一般的需要的。但是对branch的操作,由于缺乏实践,暂时不深究。

    GIT的操作一般是:
    $ cd /home/user/my_project
    $ git add *.c
    $ git add LICENSE
    $ git commit -m 'initial project version'
    如果想要可视化的界面的支持的话,除了安装官方的git外,还可以选择性地安装tortoiseGit。
    这样在Windows界面上就可以进行右键的可视化操作了。和操作SVN的感觉差不多。

    其他:

    -----------------

    git commit -a

    -a选项的解释:

    Tell the command to automatically stage files that have been modified and
    deleted, but new files you have not told Git about are not affected.
    这一个选项似乎可以把add命令也顺便执行一下。
    -----------------

    The Three States
    Pay attention now — here is the main thing to remember about Git if you want the
    rest of your learning process to go smoothly. Git has three main states that your
    files can reside in: committed, modified, and staged:

    Committed means that the data is safely stored in your local database.
    上句翻译:已经commit的表示已经安全存入到本地的数据库中了。
    Modified means that you have changed the file but have not committed it to your
    database yet.
    上句翻译:修改的就是已经修改,但是没有进行任何git操作的。
    Staged means that you have marked a modified file in its current version to go
    into your next commit snapshot.
    上句翻译:操作为标记为已缓存。
    -----------------
    git add .
    add命令把当前的snapshot更新到staging中。为以后的commit做准备。

     参看资料:所有内容均可以在 https://git-scm.com/ 上查看到。并同时参考了其他人的cnblogs上的文章。

  • 相关阅读:
    批量修改数据后应收集统计信息
    this,this,再次讨论javascript中的this,超全面
    javascript中的闭包,超简单论述,保证小学生必懂
    有四中方法可以实现PHP的伪静态,你造吗?
    javascript 事件传播与事件冒泡,W3C事件模型
    浅谈asp.net性能
    div浮动层 兼容IE FF
    我们这些程序员
    c++学习笔记_1
    windows下hexo+github搭建个人博客
  • 原文地址:https://www.cnblogs.com/praiseslow/p/10362490.html
Copyright © 2011-2022 走看看