关于仓库转移 重新拉取git代码

本文介绍了如何在Git中查看、删除和修改代码的远程仓库地址,包括`gitremote-v`、`gitremoteremove`和`gitremoteadd`命令的使用,以及遇到`gitpull`错误`Thereisnotrackinginformationforthecurrentbranch`时的解决方法。
摘要由CSDN通过智能技术生成

1、进入项目终端或者idea的Terminal查看代码已绑定的git仓库地址

git remote -v


2、删除本地关联的git仓库地址

git remote rm origin


3、本地代码关联新的仓库地址

git remote add origin 新地址


4、再次查看本地代码关联的git仓库地址是否正确

git remote -v


5、确认无误后即可再次提交和推送代码到代码仓库啦

git pull 报错:There is no tracking information for the current branch.

git pull 报错:There is no tracking information for the current branch.-CSDN博客

git 拉取远程时报如下错误:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.

问题描述:提示branch没有跟踪信息
解决方案
1.直接指定远程分支

git pull origin master


2.先指定本地master到远程的master,然后再去pull

git  branch --set-upstream-to=origin/master master
git  pull

我的本地分支名称为master,远程分支名称也是master。

--------------------------------------------------------------------------------------------------------

我本地分支名称ruoyiPlus,远程分支也是ruoyiPlus

切换到本地分支ruoyiPlus

git checkout ruoyiPlus

拉取远程ruoyiPlus分支的最新变更: 在确保没有冲突的情况下,使用git pull命令从远程仓库拉取最新的变更

  1. 设置本地分支追踪远程分支: 如果之前没有设置过追踪关系,可以使用以下命令进行设置:

 git branch --set-upstream-to=origin/ruoyiPlus ruoyiPlus

拉取

git pull

但是,通常在执行git pull时,如果本地分支已经设置了追踪远程分支,那么这个步骤会被自动完成。所以,如果你已经设置过追踪关系,只需要执行git pull origin ruoyiPlus即可。

git pull origin ruoyiPlus

  • 6
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值