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

来自linux中国网wiki
跳到导航 跳到搜索


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仓库