git 更改远程仓库地址,强行推送远程仓库

强行推送远程仓库html

#把一个现有的工程拷贝一份
#去掉远程仓库关联
git remote rm origin
#添加远程仓库关联
git remote add origin http://xxx.git
#强行推送
git push origin --force

#可能会推不上去,提示,要肯定推进到哪一个分支
$ git push origin --force
fatal: The current branch dev has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin dev

#按照提示操做,直推送 dev 分支到远端
git push --set-upstream origin dev
相关文章
相关标签/搜索