How to fix the problem of executing “gitenv.csh” file failed
The Problem
Today when I checkout from one branch to another branch,I can’t use the command of ‘rsarte_rac_oam’.I guess there has someting wrong with my gitenv,so I execute the gitenv.csh with the command source gitenv.csh but failed.
The Reason
The reason is that whenever we checkout form one branch to another,we should clean some tmp config/files of the last branch.If we don’t do that,it may occur faults.
How To Fix This Problem
- Clean up the submodules
git submodule foreach git clean -dfx
- Clean up lrat
git clean -dfx
- Switch to your local dev branch
git checkout dev
- Fetch the latest from origin/dev and prune any branches that no longer exist
git fetch -p
- Reset your dev branch to match origin/dev
git reset --hard origin/dev
- Update the submodules
git submodule update
- Reset your environment
source gitenv.csh (or gitenv_dul20.csh, or gitenv.sh, or gitenv_dul20.sh)
- If these operations don’t work,you need to create a new repo.
How To Avoid This Problem
- Whenever you change your working branch,please do the command source gitenv.csh at once.

本文介绍了一个关于执行gitenv.csh文件失败的问题及其解决办法。问题出现在从一个分支切换到另一个分支时,无法使用某些命令。解决步骤包括清理子模块、临时配置文件,并重置工作环境。

1240

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



