github是现代的代码库,各种牛人,各种开源,也是现在大公司招聘的一个考察点,

这里介绍一下怎样把本地源码提交到github上。

  首先我们需要在github上创建一个respository。

github的提交源码到服务器

2,输入相关信息

github的提交源码到服务器

 

4,在终端中进入到你的项目的文件夹,也即是你要提交的项目。

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/你的github的名字/刚才建的resposity的名字.git
git push -u origin master

 

这样就可以把项目提交到github上了,但是如果我们再次像提交一个项目的时候,

在输完指令后
git remote add origin https://github.com/你的github的名字/刚才建的resposity的名字.git

会提示:fatal: remote origin already exists

其实我们只要执行:就可以了,

git remote rm origin

 也即比上一次的指令多了一条这样的信息。我们就可以第二次提交源码了。

 

 

作者:Darren

微博:@IT_攻城师

出处:http://www.cnblogs.com/fengtengfei/

 

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2022-01-08
  • 2021-09-21
  • 2022-02-01
  • 2022-01-29
  • 2021-07-22
猜你喜欢
  • 2022-12-23
  • 2021-12-03
  • 2021-07-21
  • 2021-11-28
  • 2021-08-24
  • 2022-01-19
相关资源
相似解决方案