工作中git操作必不可少,免不了给新人开git,项目地址等,以下是经常用到的命令
Git全局设置
git config --global user.name "name"
git config --global user.email "name@.com"
创建一个新的仓库
git clone ssh://gitadmin.git
cd mulu
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 ssh://admins.git
git add .
git commit -m "Initial commit"
git push -u origin master
现有的Git存储库
cd existing_repo
git remote rename origin old-origin
git remote add origin ssh://admin.git
git push -u origin --all
git push -u origin --tags
image
更多详解:
喜欢可以加Q群号:913934649,点赞,评论;
简书: https://www.jianshu.com/u/88db5f15770d
网友评论