Git常用操作
常用操作
1. 仓库创建Git项目
gitLab或者Github上创建一个空白项目 shiro-demo,获得项目仓库地址:https://gitee.com/xxx/shiro-demo.git
2. 本地电脑上执行Git 全局设置:
```
git config --global user.name "git账户的用户名"
git config --global user.email "git账户的邮箱"
```
3. 如果本地从0开始编写代码,需要先创建 git 仓库:
```
mkdir shiro-demo
cd shiro-demo
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/xxx/shiro-demo.git
git push -u origin master
```
4. 本地已有仓库,则直接与仓库建立联系
```
cd existing_git_repo
git remote add origin https://gitee.com/xxx/shiro-demo.git
git push -u origin master
```
本文来自博客园,作者:江南西道,转载请注明原文链接:https://www.cnblogs.com/jiangnanxidao/p/15511335.html