Github使用1-入门

Gighub官网:https://github.com/

Github的入门使用流程:

1、注册github帐号。

2、登陆帐号后创建一个repository。如命名为:GitTest

点击进入后得到其地址:

https://github.com/Thinkerfans/GitTest

3、安装git 工具。(linux系统上)

4、将gitHub上帐号绑定到git工具上。若不绑定,当你执行git commit  是报如下错误。

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fans@yuan:src$ git config  --global user.email "2656079093@qq.com"
fans@yuan:src$ git config --global user.name "thinker"
此邮件和用户名就是你gitHub上Profile里面的用户名和邮箱号。


5、在本地电脑上创建一个文件夹,如:gitspace

6、转到此目录下,执行git init

fans@yuan:gitspace$ git init
Initialized empty Git repository in /home/fans/gitspace/.git/

7、将github上创建的仓库GitTest拷贝到gitspaces目录下

fans@yuan:gitspace$ git clone https://github.com/Thinkerfans/GitTest
Cloning into 'GitTest'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
fans@yuan:gitspace$ ls
GitTest

8、本地编辑后同步到gitHub上的步骤:

fans@yuan:GitTest$ vim test.c
fans@yuan:GitTest$ 
fans@yuan:GitTest$ 
fans@yuan:GitTest$ ls
README.md  test.c
fans@yuan:GitTest$ git add test.c
fans@yuan:GitTest$ git commit -m "add test.c file"
[master 107f2db] add test.c file
 1 file changed, 4 insertions(+)
 create mode 100644 test.c
fans@yuan:GitTest$ git pu
pull   push   
fans@yuan:GitTest$ git push 
Username for 'https://github.com': Thinkerfans
Password for 'https://Thinkerfans@github.com': 
To https://github.com/Thinkerfans/GitTest
   1b0439b..107f2db  master -> master
查看gitHub上是否已经有test.c这个文件。










  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值