github 在ubuntu 使用--使用

##使用git

#创建git 的根目录

mkdir -p ~/git/testing   
 cd ~/git/testing  

#创建测试文件

touch REAME 

#初始化该目录

git init  

#新增文件到git 注意后面的 . 表示当前目录--没有提示信息就是好的提示信息,但没有说明git 也不会返回提示信息

git add .  

#提交所有文件--m表示message , -a 表示所有

git commit -m "Initial Commit" -a  

#提交特定文件--file 指定文件

git commit -m "Initial Commit" file  

#在github上创建一个repository 并复制URL

#提交到git的项目----ssh://git@git.domain.tld/repository.git  为你新创的repository 的url

git remote add origin ssh://git@git.domain.tld/repository.git   

#查看

git remote -v  

#提交你的代码

git push origin master  

#参照

https://www.digitalocean.com/community/tutorials/how-to-use-git-effectively

原文地址:https://www.cnblogs.com/luowBlog/p/8243114.html