项目上实用的git 命令提交步骤

1、拉取代码-test分支

E:\6jiehui>git pull origin test —》拉取代码-test分支
Username for ‘http://6jiehui.com:8080’: 6jiehui    // 输入账号
Password for ‘http://6jiehui@6jiehui.com:8080’:   // 输入密码
From http://6jiehui.com:8080/6jiehui
* branch test -> FETCH_HEAD
Already up to date.

 

2、列出提交的文件

E:\6jiehui>git status –》会列出提交的文件
On branch test
Your branch is up to date with ‘origin/test’.

Changes not staged for commit:
(use “git add <file>…” to update what will be committed)
(use “git checkout — <file>…” to discard changes in working directory)

modified: src/6jiehui/web/util/RechargeSrv.java
modified: src/6jiehui/web/wxcontroller/WxApiController.java
modified: src/resources/merchant.properties
modified: src/resources/spring/applicationContext-web.xml

Untracked files:
(use “git add <file>…” to include in what will be committed)

src/js/picker.js
src/web/

no changes added to commit (use “git add” and/or “git commit -a”)

3、添加要提交的文件

E:\6jiehui>git add src/spring/applicationContext-web.xml

E:\6jiehui>git add src/resources/merchant.properties

E:\6jiehui>git add src/6jiehui/web/wxcontroller/WxApiController.java

E:\6jiehui>git add src/6jiehui/web/util/RechargeSrv.java

E:\6jiehui>git commit -m “提交测试文件”
[test 9d996ba06] 提交测试文件
4 files changed, 121 insertions(+), 122 deletions(-)

 

4、最终提交到线上

E:\6jiehui>git push origin test —》最终提交到线上
Username for ‘http://6jiehui.com:8080’: 6jiehui
Password for ‘http://6jiehui@6jiehui.com:8080’:
Counting objects: 17, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (17/17), 2.07 KiB | 705.00 KiB/s, done.
Total 17 (delta 12), reused 2 (delta 0)
To http://6jiehui.com:8080/6jiehui.git
e9ddb1923..9d996ba06 test -> test

5、删除文件
E:\6jiehui> rm src/components/test.vue

 

PS:如果 git pull origin test 时候冲突,把要合并的文件还原掉,再git pull origin test

E:\6jiehui> git commit -m “注释”

本站资源全部来源于网络,如有失效或者侵权请联系客服

评论0

请先

没有账号? 忘记密码?