您的位置:首页 > 大数据 > 人工智能

How to fix the problem of executing gitenv.csh file failed

2017-07-26 16:54 459 查看

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux git
相关文章推荐