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上的文章。

转载于:https://www.cnblogs.com/praiseslow/p/10362490.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值