惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
雷峰网
雷峰网
Recent Announcements
Recent Announcements
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
博客园_首页
The Cloudflare Blog
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
S
SegmentFault 最新的问题
P
Proofpoint News Feed
Y
Y Combinator Blog
Jina AI
Jina AI
博客园 - 聂微东
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
F
Full Disclosure
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
T
Tailwind CSS Blog
J
Java Code Geeks
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Blog of Author Tim Ferriss
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 三生石上(FineUI控件)
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
宝玉的分享
宝玉的分享
IT之家
IT之家
Hacker News: Ask HN
Hacker News: Ask HN
The Register - Security
The Register - Security
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs

博客园 - Henry Cui

招聘高级.Net工程师 Node.js Web开发(二)认识Express(上) Node.js Web开发(一)从零开始 Html5 Step by Step(二) 本地存储 HTML 5 Step by Step(一) 拖放API DDD中的Specification模式 Silverlight 4之旅(三)数据绑定(中) Silverlight 4之旅(二)数据绑定(上) Silverlight 4之旅(一) .Net 4.0 Parallel 编程之旅 .Net 4.0 Parallel 编程(九)Task中的数据共享(下) .Net 4.0 Parallel编程(八)Task中的数据共享(中) .Net 4.0 Parallel 编程(七)Task中的数据共享(上) .Net 4.0 Parallel 编程(六)Task(下) .Net 4.0 Parallel 编程(五)Task(中) .Net 4.0 Parallel 编程(四) Task(上) Entity Framework Code-First(下) Entity Framework Code-First(上) Entity Framework POCO T4模板使用
Git学习笔记(一)初识Git
Henry Cui · 2012-02-02 · via 博客园 - Henry Cui

2012-02-02 20:38  Henry Cui  阅读(6175)  评论()    收藏  举报

Git/GitHub已经火爆很长时间了,我已经落伍了。不管怎样现在学习也不为晚,今年也争取走出.Net,看看外面的世界。

安装Git

这里只在Window下进行的,首先从这里下载Git.exe。下载完成后,然后就进行Next、Next、Next…

生成SSH

安装完成后,进行SSH的生成跟设置,打开“Git Bash”

1.判断是否已经创建了ssh:

$ cd ~/.ssh

第一次安装完,一般提示为No.

2.生成ssh

$ ssh-keygen -t rsa -C henllyee@126.com

这里使用您自己的邮箱

默认会生成id_dsa.pub文件在C:\Users\YourUserName\.ssh

3.将ssh key 跟Git Hub联系起来

点击“Account Setting”image,选择image,点击"Add another public key ",将刚才生成的文件里面的内容拷贝到Key中。

4.测试是否可以连接上Github

$ ssh -T git@github.com

提示以下信息表示OK.

image

到这里,我们的SSH Key就生成完成了。这步的主要作用是,机器上的Git要跟GitHub进行连接必须要进行身份认证,ssh key即身份认证的凭证。

设置自己的用户信息

1.设置用户名称和邮箱信息

$ git config --global user.name "Firstname Lastname"

$ git config --global user.email "your_email@youremail.com"

2.设置Token

为了在一些其他工具使用git的时候并没有没有ssh key,这个时候需要我们配置我们的API token。在Account Setting里面选择“Account Admin”,可以找到我们的Token信息。

$ git config --global github.user username

$ git config --global github.token yourtoken

创建第一个Repository

1.创建Repository

点击“New repository”image,这里我们取名Repository名字为“Test”.

2.创建本地项目

$ mkdir Test
创建 “Test”目录
$ cd Test
$ git init
git初始化
$ touch README
$ git add README
增加README文件
$ git commit README
$ git commit -m 'first commit'
$ git remote add origin git@github.com:henllyee/Test.git
$ git push -u origin master
提交到github中
这个时候在Repository中就可以看到提交进去的README文件:
image

总结

本篇post主要是初步认识下git/github,后面详细学习下git的常用命令。