【Github入门与实践学习笔记】
2.Git安装
下载Git:在http://msysgit.github.io/中
建立SSH Key:这个网上有教程
创建仓库:勾选Initialize...的一项(如果是添加,就不用勾选,不知为啥)
clone仓库:在SSH后面复制路径
然后在git base如下

(clone后面的路径是前面复制的,不同;还有此刻克隆的文件是在desktop下面,可以先cd进入到目标路径,再clone)
进入Leetcode

(后面的master不知道是什么东西)
然后我在Leetcode文件夹里面添加了IntToRoman.java(就是我桌面上的Leetcode文件夹,可以看上面的命令,我自己克隆到桌面上了)
然后使用status查看一下,如下图

($ git status : Lists all new or modified to be committed)
然后add,如下图

提交

($ git commit -m “[descriptive message]” : Records file snapshots permanently in version history. 这个引号里面的字符会在后面图中显示,是用来描述提交文件的信息的)
最后将文件更新到Github上

($ git push[alias][branch] : Uploads all local branch commits to Github)
以上便完成了代码提交到Github
2.Git安装
下载Git:在http://msysgit.github.io/中
初始设置:设置姓名和邮箱(最好和Github账号一致,图个简便)
建立SSH Key:这个网上有教程
创建仓库:勾选Initialize...的一项(如果是添加,就不用勾选,不知为啥)
clone仓库:在SSH后面复制路径
然后在git base如下
(clone后面的路径是前面复制的,不同;还有此刻克隆的文件是在desktop下面,可以先cd进入到目标路径,再clone)
进入Leetcode
(后面的master不知道是什么东西)
然后我在Leetcode文件夹里面添加了IntToRoman.java(就是我桌面上的Leetcode文件夹,可以看上面的命令,我自己克隆到桌面上了)
然后使用status查看一下,如下图
($ git status : Lists all new or modified to be committed)
然后add,如下图
提交
($ git commit -m “[descriptive message]” : Records file snapshots permanently in version history. 这个引号里面的字符会在后面图中显示,是用来描述提交文件的信息的)
最后将文件更新到Github上
($ git push[alias][branch] : Uploads all local branch commits to Github)
以上便完成了代码提交到Github
如下图: