1:查看版本关联关系
git branch -vv
2:查看所有分支
git branch -a
3:指定从哪个远程仓库拉取代码
git pull origin B#fenglebing-otn
例如:
帮冯乐兵删除文件[手动删掉之后]
yangl-006305@RC0006305 MINGW64 /e/tiap-code/tiap-webapp (B#yanglin)
$ git status
On branch B#yanglin
Changes not staged for commit:
(use “git add/rm …” to update what will be committed)
(use “git checkout – …” to discard changes in working directory)
modified: app.js
modified: config/default.json
modified: extroot/app/Application.js
deleted: extroot/app/view/tiap/otn/common/resModelForm.js
deleted: extroot/app/view/tiap/otn/common/resModelgrid.js
no changes added to commit (use “git add” and/or “git commit -a”)
yangl-006305@RC0006305 MINGW64 /e/tiap-code/tiap-webapp (B#yanglin)
$ git add extroot/app/view/tiap/otn/common/resModelForm.js
yangl-006305@RC0006305 MINGW64 /e/tiap-code/tiap-webapp (B#yanglin)
$ git add extroot/app/view/tiap/otn/common/resModelgrid.js
yangl-006305@RC0006305 MINGW64 /e/tiap-code/tiap-webapp (B#yanglin)
$ git commit extroot/app/view/tiap/otn/common/resModelForm.js -m “flb delete file”
git commit extroot/app/view/tiap/otn/common/resModelgrid.js -m “flb delete file”
4:从我的分支推送代码到老冯的分支
git push origin B#yanglin:B#fenglebing-otn
5:关联远程分支
git push -u origin B#yanglin
开发中创建了自己的特性开发分支之后,切换到自己特性分支之后,使用如上命令之后自动与gitlab上的远程分支关联,无需手动在gitlab上创建。
6:刷新远程操作
git remote update origin -p
7. git中关系图

- Workspace:工作区
- Index / Stage:暂存区
- Repository:仓库区(或本地仓库)
- Remote:远程仓库

本文介绍了Git中常用的命令操作,包括版本关联、分支管理、远程仓库同步等,详细展示了如何通过具体命令进行文件删除、分支推送及远程更新,帮助读者掌握Git的基本使用技巧。
3322

被折叠的 条评论
为什么被折叠?



