git操作

快速设置 - 如果你以前做过这种事情

HTTPSSSH

Get started by creating a new file. We recommend every repository include a README, LICENSE, and .gitignore.
Git global setup

git config --global user.name "xxx"
git config --global user.email "xxx@163.com"

或在命令行上创建一个新的存储库

git clone https://github.com/diablo-monkey/chaosblade-exec-jvm.git
cd chaosblade-exec-jvm
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

或从命令行推送现有空的存储库

cd existing_folder
git init
git remote add origin https://github.com/diablo-monkey/chaosblade-exec-jvm.git
git add .
git commit -m "Initial commit"
git push -u origin master

或从命令行推送已有存储库

cd existing_repo
git remote set-url origin https://github.com/diablo-monkey/chaosblade-exec-jvm.git
git push --all https://github.com/diablo-monkey/chaosblade-exec-jvm.git

将服务器上的秘钥放到git仓库中去

ssh-keygen -t rsa -b 4096 -C "hanboyuan@jd.com" # 生成秘钥路径为/root/.ssh/id_rsa.pub 
cat /root/.ssh/id_rsa.pub  # 获取秘钥内容,通过该内容添加到git仓库中去

posted @ 2021-03-10 14:46  SpecialSpeculator  阅读(54)  评论(0编辑  收藏  举报