技术文

Git 常用命令

2016-12-08  本文已影响0人  BoTang

git config --global user.name "Your Name"  配置用户名

git config --global user.email your.email@example.com 配置用户邮箱

git init                      初始化项目

git status                 查看当前状态

git add -A                添加

git commit -m ‘    ’  提交

git log                   查看提交记录

git checkout -f    强制撤销上次改动

git remote add origin git@github.org:/hello_app.git   选择仓库源

git push -u origin --all            push到仓库

git checkout -b modify-README    创建分支并切换到该分支

git branch       查看所有分支 

git checkout master    切换回主支

git merge modify-README   将分支与主支合并

git push 推送到仓库

git checkout -d modify-README 删除分支

上一篇 下一篇

猜你喜欢

热点阅读