git环境开发问题-处理

【开发环境】

git问题

让git不跟踪.pyc文件:

首先把之前的pyc文件删除:

git rm -f ./\*.pyc

然后在.gitignore的末尾添加:

*.pyc

.vscode/

同时屏蔽掉pyc, .vscode/文件的数据的变更

git登陆问题

Command line instructions

You can also upload existing files from your computer using the instructions below.

Git global setup
git config --global user.name "xxx"
git config --global user.email "xxx@xxx.com"

git删除分支:

git branch -d local_branch_name

git删除commit信息

git commit --amend //这将会把最后一个commit合并到前一个提交中去

git修改commit分支

修改最近提交的 commit 信息

git commit --amend --message="modify message by daodaotest" --author="xxx <xxx@163.com>"

仅修改 message 信息

git commit --amend --message="modify message by daodaotest"

仅修改 author 信息

git commit --amend --author="xxx <xxx@xxx.com>"

git拉取远端分支合并本地:

git fetch --all

git reset --hard origin/feature-3.4.0-performance-optimazition

VSCode的debug配置

遇到闪退问题,将python 版本降低至其它版本即可。

参考 :

VSCode中python无法调试(调试闪退)的解决方法_vscode python debug闪退-CSDN博客

git 修改分支名称:

首先 git branch -m 旧分支名 新分支名

其次 git push --delete origin 旧分支名

将新分支名推上去

git push origin --set-upstream 新分支名

git ignore失效:

0. 进入项目路径

1. 清除本地当前的Git缓存

git rm -r --cached .

2. 应用.gitignore等本地配置文件重新建立Git索引

git add .

3. (可选)提交当前Git版本并备注说明

git commit -m 'update .gitignore'

git拉取远端分支到本地:

git fetch origin ac_branch:ac_branch 拉取远程分支到本地(方式二)

切换远程分支:

git checkout -b b350-py36pt1101cu102.-2.0.1 origin/b350-py36pt1101cu102.-2.0.1

git回退

git reset --hard d27236a72e8919051d2e0f356af9dabf7ffa09

commit信息修改

git commit --amend

删除分支:

git branch -D

修改commit之前的分支:

git log 找到需要修改分支 的ID

复制代码
` `git rebase -i 8876a66df1ea4a7e911c271b2bd3292ddfa1eca0`
`

Git 如何修改历史 Commit message

相关推荐
Moshow郑锴9 小时前
Git如何上传目录到github项目进行初始化
git
疯狂成瘾者9 小时前
上传到 GitHub 的步骤总结
大数据·elasticsearch·github
七夜zippoe13 小时前
OpenClaw 接入 WhatsApp:消息推送实战
大数据·人工智能·microsoft·whatsapp·openclaw
RFID科技的魅力13 小时前
从开箱到实战:CP300R触屏RFID打印机全场景使用测评
大数据·人工智能·物联网·rfid
Elasticsearch14 小时前
Elasticsearch:如何在 workflow 里调用一个 agent
elasticsearch
Forrit16 小时前
Agent长期运行(Long-Running Tasks)实现方案与核心挑战
大数据·人工智能·深度学习
2601_9553631516 小时前
技术赋能B端拓客:号码核验的行业困局与破局路径氪迹科技法人股东筛选系统,阶梯式价格
大数据·人工智能
财经资讯数据_灵砚智能17 小时前
全球财经资讯日报(夜间-次晨)2026年3月28日
大数据·人工智能·python·语言模型·ai编程