标签:git init 主机名 步骤 获取 进入 new 上传文件 default 初始化
git init
git init xxx
.git的隐藏文件夹git@github.com:phd99/test.git设置一个别名testgit remote add 别名 git@github.com:phd99/test.git
git remote -v
git remote rm [别名]
SSH。创建过程中会要求设置密码,可以不设置密码,直接按回车键ssh-keygen -t rsa -C "email"
id_rsa是私钥,id_rsa.pub是公钥,默认位置在C:\Users\用户名\.ssh中。github中
Settings->SSH and GPG keys->New SSH keyid_rsa.pub公钥文件中的内容复制到Key中ssh -T git@github.com
git clone https://github.com/phd99/test.git
git clone -b 分支名 https://github.com/phd99/test.git
git pull origin myblog
pull和clone的区别
clone是从无到有的过程pull是已有本地仓库,想获取最新的项目内容.表示将文件夹中的所有内容都写入暂存区git add .
git commit -m [备注信息]
-u后,以后可以直接git push省略了后面的内容本地分支名和远程分支名相同,则可以省略远程分支名不写git push -u <远程主机名> <本地分支名>:<远程分支名>
git branch
Settings->Branches->Default branch标签:git init 主机名 步骤 获取 进入 new 上传文件 default 初始化
原文地址:https://www.cnblogs.com/phd99/p/14408292.html