怎么在github上建立自己的代码仓库
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了怎么在github上建立自己的代码仓库相关的知识,希望对你有一定的参考价值。
参考技术AGithub是一个分布式版本控制系统,最初由Linux之父Linus Torvalds编写,在云时代的今天已经成为了开发者管理代码和发现已有代码的最常用工具之一,下面我们将开始git之旅。
注册Github账号:
首先打开Github主页,https://github.com 如果你没有登录过的话会打开如下图的界面,
注意右侧不是登陆界面而是注册界面,按要求填写用户名,邮箱,密码,点击Sign up for Github,开始注册账号。
保持personal plan下面的Free选中(如果想使用private的代码仓库的话可以选择其他选项,¥¥),先不选Help me set up an organization next,点击Finish sign up。
一个Github账号就创建成功了,接下来创建一个代码仓库(repository):
点击右边的+New repository开始创建仓库,如图,
在图中repository name下写上你的仓库名,在Description那里填写描述(可选不填),保持Public选中(如果选Private可以选择谁能看到谁能提交,public只能选谁能提交,private是要钱的¥),下面Initialize this repository with a README决定是否生成一个README文件来初始化仓库,可选可不选,点击Create
repository。
这样就生成了一个代码仓库了,如图中HTTP中的地址就是该仓库的地址,你可以通过git工具来访问到你保存在Github上的代码,也可以点击切换到SSH来生成SSH地址,点击地址邮编的按钮可以复制地址,如果在命令行中使用git的话可以使用下面提供的命令创建仓库。
创建一个仓库:
[plain] view plain copy
<span style="font-size:18px;">touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/kezhenxu/android.git
git push -u origin master</span>
这样,一个属于你自己的Github仓库就完成了,接下来就可以在eclipse中开始编写代码并且同步到Github上了,把Github当作一个代码备份和中转站确实是一个好主意,不过通过Github分享你的代码给所有人用或许才是Github更有价值的体现。怎么上传自己的代码/项目到自己的github仓库上


















以上是关于怎么在github上建立自己的代码仓库的主要内容,如果未能解决你的问题,请参考以下文章
上传及更新代码到github(以及如何在vscode上提交自己的代码)