摘要.
缩写记录:https://blog.csdn.net/maitiandaozi/article/details/51556323
git rebase origin/dev如果已经提交到线上,会把自己到提交放到dev后面,造成提交失败
如果已经提交,或分支版本混乱,使用git reflog查看修改记录git reset xxx返回到对应版本
git reset HEAD --hard
gd HEAD^ HEAD # 查看代码修改
gf
gm origin/dev(git merge origin/dev 合并dev的修改)
git push origin xxx(gp origin xxx)
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit ● git add yb_adm/handlers/credit.py
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit ✚ git commit -m "合并最新代码,重新测试"
Flake8...................................................................Passed
Check docstring is first.................................................Passed
Debug Statements (Python)................................................Passed
Reorder python imports...................................................Passed
pyupgrade................................................................Passed
Pylint Score Limit.......................................................Passed
ESLint...............................................(no files to check)Skipped
[qifeng/feature-485_feat_batch_credit_edit deb9ba736] 合并最新代码,重新测试
1 file changed, 1 insertion(+)
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit git push origin qifeng/feature-485_feat_batch_credit_edit
To gitlab.botpy.com:Botpy/Web/Yobee-Agent-Admin.git
! [rejected] qifeng/feature-485_feat_batch_credit_edit -> qifeng/feature-485_feat_batch_credit_edit (non-fast-forward)
error: failed to push some refs to 'git@gitlab.botpy.com:Botpy/Web/Yobee-Agent-Admin.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
(admin) ✘ ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit git log
(admin) ✘ ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit git reflog
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit git reset bae768a66
Unstaged changes after reset:
D .coverage 2
M tests/apps/settlement/handler/test-init.m.sql
M tests/handlers/credit_test.py
M tests/handlers/test-init.sql
M www/static/js/order/order-detail.js
M www/template/agent/agent_add.html
M www/template/agent/credit_list.html
M www/template/agent/order_detail.html
M www/template/include/order_operation.html
M yb_adm/handlers/credit.py
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit ● gst
On branch qifeng/feature-485_feat_batch_credit_edit
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: .coverage 2
modified: tests/apps/settlement/handler/test-init.m.sql
modified: tests/handlers/credit_test.py
modified: tests/handlers/test-init.sql
modified: www/static/js/order/order-detail.js
modified: www/template/agent/agent_add.html
modified: www/template/agent/credit_list.html
modified: www/template/agent/order_detail.html
modified: www/template/include/order_operation.html
modified: yb_adm/handlers/credit.py
no changes added to commit (use "git add" and/or "git commit -a")
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit ● git reflog
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit ● git reflog
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit ● git reset bae768a66
Unstaged changes after reset:
D .coverage 2
M tests/apps/settlement/handler/test-init.m.sql
M tests/handlers/credit_test.py
M tests/handlers/test-init.sql
M www/static/js/order/order-detail.js
M www/template/agent/agent_add.html
M www/template/agent/credit_list.html
M www/template/agent/order_detail.html
M www/template/include/order_operation.html
M yb_adm/handlers/credit.py
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit ● git log
(admin) ✘ ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit ● gd HEAD^ HEAD
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit ● git reset HEAD --hard
HEAD is now at bae768a66 feat(优豆批量编辑): 增加优豆批量编辑功能
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit gf
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit gm origin/dev
Auto-merging tests/handlers/credit_test.py
Removing .coverage 2
Merge made by the 'recursive' strategy.
.coverage 2 | Bin 827392 -> 0 bytes
tests/apps/settlement/handler/test-init.m.sql | 2 +-
tests/handlers/credit_test.py | 2 +-
tests/handlers/test-init.sql | 2 +-
www/static/js/order/order-detail.js | 4 +++
www/template/agent/agent_add.html | 15 +++++++---
www/template/agent/credit_list.html | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
www/template/agent/order_detail.html | 3 +-
www/template/include/order_operation.html | 4 +--
9 files changed, 157 insertions(+), 24 deletions(-)
delete mode 100644 .coverage 2
(admin) ~/Desktop/Yobee-Agent-Admin qifeng/feature-485_feat_batch_credit_edit gp origin qifeng/feature-485_feat_batch_credit_edit
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 4 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 558 bytes | 558.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0)
remote:
remote: View merge request for qifeng/feature-485_feat_batch_credit_edit:
remote: https://gitlab.botpy.com/Botpy/Web/Yobee-Agent-Admin/-/merge_requests/5487
remote:
To gitlab.botpy.com:Botpy/Web/Yobee-Agent-Admin.git
bae768a66..baad35a60 qifeng/feature-485_feat_batch_credit_edit -> qifeng/feature-485_feat_batch_credit_edit