git 常用操作------实战

提交代码流程

增加:git  add    url  (尽量不要用  git add .)

提交:git commit -m   注释

拉取:git pull <remote>  <branch>

推送:git push <remote>  <branch>

查看分支

git  branch -a

切换分支

 git checkout -b 分支名称

 

查看当前状态(有没有修改的文件等)

git status

查看日志

git  log

把文件改回到之前的某个版本

版本值:git  log  后 commit  后面跟的字符串便是

git checkout   版本值  文件路径

git合并分支

切换到要合并的分支

git pull origin 要合并的分支

切回自己的分支

git  merge 要合并的分支

扫描二维码关注公众号,回复: 12385386 查看本文章

猜你喜欢

转载自blog.csdn.net/liuhao9999/article/details/111933969