赞
踩
目录
git config --global user.name "your name" git config --global user.email "your email@163.com"
在远程的github、gitee公有仓库平台或是自己的私有git服务里创建一个仓库,如swy-stock
以gitee为例:创建你的第一个仓库 - Gitee.com
创建 git 仓库:
mkdir swy-stock cd swy-stock git init touch README.md git add README.md git commit -m "first commit"
已有仓库?
cd swy-stock
git remote add origin https://gitee.com/swy/swy-stock.git git push -u origin "master"
git remote show origin
- * remote origin
- Fetch URL: https://gitee.com/swy/swy-stock.git
- Push URL: https://gitee.com/swy/swy-stock.git
- HEAD branch: master
- Remote branches:
- master tracked
git remote -v
- origin https://gitee.com/swy/swy-stock.git (fetch)
- origin https://gitee.com/swy/swy-stock.git (push)
- origin2 https://github.com/swy/swy-stock.git (fetch)
- origin2 https://github.com/swy/swy-stock.git (push)
比如切换到origin2
git fetch origin2
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。