“将git本地创建的项目推送到github仓库”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
→‎her
 
第4行: 第4行:
 
<pre>
 
<pre>
  
cd docker-ubuntu/
+
1.
  1012 18:57 git init
+
cd docker-ubuntu/
  1013 18:57 vim README.txt
+
git init
  1014 18:57 ls
+
vim README.txt
  1015 18:57 git add .
+
git add .
  1016 18:57 ls -al
+
git commit -m 'ubuntu first commit'
  1017 18:57 git commit -m 'ubuntu first commit'
 
 
 
 
    
 
    
  生成一个新的仓库,新仓库肯定是空的,github明确告诉我们有三种方式更新我们的资源:
+
2. 
 +
生成一个新的仓库,新仓库肯定是空的,github明确告诉我们有三种方式更新我们的资源:
  
  
第32行: 第31行:
 
…or import code from another repository
 
…or import code from another repository
  
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
+
3.
 
+
git remote add origin [email protected]:evan886/docker-ubuntu.git
  1018 18:58 git remote add origin [email protected]:evan886/docker-ubuntu.git
+
git push -u origin master
  1019 18:58 git push -u origin master
 
 
 
  
 +
ps:
 
.git/config  #正常是 git 不是https  
 
.git/config  #正常是 git 不是https  
 
url = [email protected]:evan886/docker-ubuntu.git
 
url = [email protected]:evan886/docker-ubuntu.git
 
</pre>
 
</pre>
 +
 
=see also=
 
=see also=
  
 
[https://www.cnblogs.com/tdcqma/p/6715829.html 如何将git本地创建的项目推送到github仓库]
 
[https://www.cnblogs.com/tdcqma/p/6715829.html 如何将git本地创建的项目推送到github仓库]

2020年2月14日 (五) 15:38的最新版本


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