配置用户名和邮箱:
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
使用 --global 修饰后设置的全局的用户,如果设置单个项目的用户,可cd到项目根目录下,执行如下命令:
$ git config user.name "Your Name"
$ git config user.email "email@example.com"
查询当前分支
git branch
切换分支或checkout代码
git checkout master
更新代码
git pull origin master
提交代码
1.查看提交状态
git status
提交前更新代码,master为分支名
git pull origin master
2.添加到暂存库(.可换成文件名,提交单个文件)
git add .
3.提交
git commit -m "添加的备注"
4.push分支到远程库
git push origin master
网友评论