git 上传至github出现error:your local changes to the following files would to be overwritten解决办法

Git 分支切换及文件上传错误处理
博客主要讲述了使用 Git 时遇到的问题及解决办法。从 dev 分支切换到主分支出现错误,需覆盖修改代码。先查看跟踪文件状态,添加文件使其进入跟踪状态,再切换到主分支,添加所有文件后推送到远程服务器分支。

 

git 在上传的时候出现了如下错误,当我从dev分支切换到主分支的时候出现了这个错误。修改的代码需要覆盖。ok,那在切换之前咱们按照提示

it

先查看一下跟踪的文件的状态

git status

结果如下:

然后我们添加一下这个文件。

这样,我们就可以把已经修改的文件添加到跟踪的状态中了。

接下来我们就可以切换到主分支。

git checkout master

切换后,我们添加所有文件。

git add ./*

接下来我们推送到远程服务器的分支

git push -u origin master


(MCDD) huangjunkai@DESKTOP-C7JRDCS:/mnt/webdav/luoshijun/mamba$ git checkout v1.0.0 error: Your local changes to the following files would be overwritten by checkout: .github/workflows/_build.yml .github/workflows/build.yml .github/workflows/publish.yaml .gitignore LICENSE MANIFEST.in assets/ssd_algorithm.png benchmarks/benchmark_generation_mamba_simple.py csrc/selective_scan/reverse_scan.cuh csrc/selective_scan/selective_scan.cpp csrc/selective_scan/selective_scan_common.h csrc/selective_scan/uninitialized_copy.cuh evals/lm_harness_eval.py mamba_ssm/__init__.py mamba_ssm/distributed/__init__.py mamba_ssm/distributed/distributed_utils.py mamba_ssm/distributed/tensor_parallel.py mamba_ssm/models/config_mamba.py mamba_ssm/models/mixer_seq_simple.py mamba_ssm/modules/block.py mamba_ssm/modules/mamba2.py mamba_ssm/modules/mamba2_simple.py mamba_ssm/modules/mamba_simple.py mamba_ssm/modules/mha.py mamba_ssm/modules/mlp.py mamba_ssm/modules/ssd_minimal.py mamba_ssm/ops/selective_scan_interface.py mamba_ssm/ops/triton/k_activations.py mamba_ssm/ops/triton/layernorm_gated.py mamba_ssm/ops/triton/selective_state_update.py mamba_ssm/ops/triton/ssd_bmm.py mamba_ssm/ops/triton/ssd_chunk_scan.py mamba_ssm/ops/triton/ssd_chunk_state.py mamba_ssm/ops/triton/ssd_combined.py mamba_ssm/ops/triton/ssd_state_passing.py mamba_ssm/utils/generation.py mamba_ssm/utils/torch.py pyproject.toml tests/ops/triton/test_layernorm_gated.py tests/ops/triton/test_selective_state_update.py tests/ops/triton/test_ssd.py tests/test_generation.py usage.md Please commit your changes or stash them before you switch branches. Aborting 怎么解决这个问题
09-19
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值