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

来自linux中国网wiki
Evan讨论 | 贡献2020年2月14日 (五) 11:11的版本
跳到导航 跳到搜索


her


	cd docker-ubuntu/
  1012	18:57	git init
  1013	18:57	vim README.txt
  1014	18:57	ls
  1015	18:57	git add .
  1016	18:57	ls -al
  1017	18:57	git commit -m 'ubuntu first commit'
  
  
  生成一个新的仓库,新仓库肯定是空的,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

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
  
  1018	18:58	git remote add origin [email protected]:evan886/docker-ubuntu.git
  1019	18:58	git push -u origin master


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

see also

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