记录一下git的基础使用方法,掌握后满足一般项目的使用需要
初始化
git init
登陆与配置
git config --global user.name "myname"
git config --global user.email "myemail"
复制远程项目到本地
git clone +link
关联远程库
git remote
添加修改到暂存区
git add
本地提交
git commit
修改现存的本地提交
git commit --amend
推送到远程库
git push
远程修改拉到本地
git pull
创建分支
git branch +branchname
切换分支
git checkout +branchname
查看状态
git status
查看提交记录
git log