将git本地创建的项目推送到github仓库

来自linux中国网wiki
Evan讨论 | 贡献2020年2月14日 (五) 15:38的版本 →‎her
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索


her


1.
cd docker-ubuntu/
git init
vim README.txt
git add .
git commit -m 'ubuntu first commit'
  
2.  
生成一个新的仓库,新仓库肯定是空的,github明确告诉我们有三种方式更新我们的资源:


…or create a new repository on the command line

echo "# docker-ubuntu" >> README.md
git init
git add  .
git commit -m "first commit"
git remote add origin [email protected]:evan886/docker-ubuntu.git
git push -u origin master

…or push an existing repository from the command line

git remote add origin [email protected]:evan886/docker-ubuntu.git
git push -u origin master

…or import code from another repository

3.  
git remote add origin [email protected]:evan886/docker-ubuntu.git
git push -u origin master

ps:
.git/config  #正常是 git 不是https 
url = [email protected]:evan886/docker-ubuntu.git

see also

如何将git本地创建的项目推送到github仓库