- 初始化新仓库
git init后生成.git目录 - 仓库状态
git status - 本地分支
git branch- 所有
git branch -a - 远程
git branch -r
- 所有
- 向仓库新增所有文件
git add . - 向仓库新增并提交文件
git commit -m 'author' - 提交本地仓库到远程仓库
git remote add origin git@github.com:个人github名/仓库名.git - 向远程仓库推送本地仓库修改
git push -u origin master - 克隆仓库 git clone
git://.git newNamehttps://.gituser@server:/path.git(SSH) - 登陆
git config --global user.name "Your Name"git config --global user.email "email@example.com"
- ssh
ssh-keygen -t rsa -C "youremail@example.com"- 用户主目录 id_rsa.pub 添加github