Git学习笔记

参考来自<看日志学习git>http://roclinux.cn/?cat=72

比较官方正式的是 http://git.oschina.net/progit/

git 的提示信息

―changed but not updated

已经更改,但是没有git add

―Changes to be committed

已经git add 但是没有 git commit

―Untracked files

目录已经增加新文件

命令的使用流程大概是 git add 修改过的文件 ---> git diff 和 git status 查看文件的状态 --->git commit 提交代码 ---> git log 查看日志:    这些命令可以缩写成git commit -a


学习过程记录

2014年1月7日17:29:23

说实话, 到现在为止, git 和 github有什区别我都不知道


2014年1月7日19:50:13

我是这样认为的, git中保存了仓库中所有的信息, 而不只是某一部分文件的更改部分(▽t), 而是对于每一个更改都再次复制一份当前的所有文件的情况,也就是说, 保存的不仅仅是增量


解决 An error occurred trying to download 'http://github-windows.s3.amazonaws.com/GitHub.application

可以把链接直接丢到IE浏览器的地址栏里面, 或者多重试几次


2014年1月7日21:58:41

总算是把版本库给弄好了, 根据的是教程 http://www.eoeandroid.com/thread-274556-1-1.html

之后创建了一个 ssh--key ,根据教程 https://help.github.com/articles/generating-ssh-keys

效果是这样的


2014年1月8日15:12:22

github for windows 实际上已经包含了git的基本操作, 所以没有必要安装git也同样可以使用,

GitHub for Windows 是一个 Metro 风格应用程序,集成了自包含版本的 Git,bash 命令行 shell,PowerShell 的 posh-git 扩展


把github上的项目复制的本地目录当中.

比如我在github上有LyleLee/practice 这个仓库(repository)

在本地目录下启动git bash并输入命令 git clone git://github.com/LyleLee/practice.git

然后就可以看到在F盘的根目录下多了一个文件夹 practice,在里面有所有在github上文件, 并配置了.git文件


这样, 其实很简单.


继续往下,又要出现问题了

fatal: remote  error:
you can't push to git://github.com/LyleLee/practice.git
use https://github.com/LyleLee/practice.git

根据这位大大说:是因为在clone的时候使用的是git clone git://github.com/LyleLee/practice.git, 所以只具有读权限, 而如果使用的是git clone git:@github.com:LyleLee/practice.git 注意这两者之间的冒号, 那么就具有读和写的权限.

解决办法,

git remote rm origin

git remote add origin git@github.com:LyleLee/practice.git

然后就上传成功了,

但是, warning : permanently added the RSA host key for IP address '192.30.252.130' to the list of known list
这个大概说的是, git自己把公钥自动加到~/.git/known_host文件里面了, 进去查一下,确实是这样的.总之能上传成功就是好的.


总结一下对practice的理解

  1. 在github上创建了repository,同时选中了Initialize this repository with a README. 意思就是说,远程仓库初试化,可以直接使用了, 意思就是说不用我们再在本地git init了, 可以直接把创建好的repositorygit clone到本地
  2. git clone git@github.com:Username/repository_name.git local_dir ,其中local_dir是可选的, 如果没有指定, 那么就会在当前目录下创建相应和repository_name 名字一样的本地目录, 其中包含.git配置目录
  3. 要上传自己的代码到github上,需要
  • git add file_name
  • git commit  -m "message you want to leave behind"
  • git remote rm origin
  • git remote add origin git@github.com:LyleLee/practice
  • git push -u origin master


当然也可以把本地的repository上传的到github上,首先是add 然后是commit 之后是 add origin, 然后是push, 下面是官方的教程.

执行结果



工具WebStorm

简单介绍 :http://www.cssha.com/webstorm

一些评价 :http://www.zhihu.com/question/20936155

注册码: http://www.geek521.com/?p=1948, 注册码要换成半角

AngularJS最理想开发工具WebStorm : http://blog.fens.me/angularjs-webstorm-ide/#gsc.tab=0



http://blog.csdn.net/gavincook/article/details/11992827

http://blog.sina.com.cn/s/blog_67a3453d0101j8qr.html

http://www.eoeandroid.com/thread-274556-1-1.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值