前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >初试git+github(linux环境)

初试git+github(linux环境)

作者头像
囚兔
发布2018-02-08 10:28:40
4950
发布2018-02-08 10:28:40
举报
文章被收录于专栏:IT杂记IT杂记

1、注册github,并创建代码库

        地址:https://github.com/

        注册github,登陆后, 点击右上角 “Create a new repo” 按钮,Repository name输入Hello-world, 选中 public ,

        点击Create repository按钮,库创建成功。

2、安装git,并设置git

        下载地址http://code.google.com/p/git-core/downloads/list

        安装完git后,执行:

git config --global user.name "Your Name Here"
git config --global user.email "your_email@youremail.com"

        user.name 为全局的用户名

        user.email 为github的注册邮箱,用于与github关联。        

3、创建本地库,并提交原始版本文件

        在主目录中创建Hello-world目录,进入该目录,执行git init,出现.git的隐藏子目录;创建README文件作为测试提交的文件,vi编辑该文件输入Hello World!. 

cd ~/Hello-world
git init
touch README

4、提交原始版本文件

git add README
git commit -m 'first commit'

       将README提交,此时并不影响 远程github的库。

5、PUSH到远程github

git remote add origin https://github.com/username/Hello-World.git
git push origin master

      其中https地址可以在github上找到。

shipley@linux-vo4i:~/Hello-world> git push origin master Username for 'https://github.com': username Password for 'https://hsp8712@github.com': ****** Counting objects: 3, done. Writing objects: 100% (3/3), 216 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To https://github.com/hsp8712/Hello-world.git  * [new branch]      master -> master

提交成功

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档