fatal:’origin’ does not appear to be a git repository fatal:Could not read from remote re…

Knowledge map advanced must read: read how large-scale map data efficient storage and retrieval>>>

Problems encountered in gitlab:

when git push origin branch_ The following error is reported in name:

fatal: ‘origin’ does not appear to be a git repository

name fatal:Could not Read from remote repository

reason:

local branch and remote branch are disconnected

solution:

CD local branch
1 Git branch
– * the master only displays the master

and then checks whether it has been pulled from the upstream
2. Git remote – V
– if there is nothing, it is disconnected from the upstream and cannot pull or push the code

3. Git remote add origin ssh://git@gitlab *********************************. git (address)

then
4 Git fetch origin

— the branch status of the drop-down list will be displayed

in the format of from ssh://gitlab. ********************************

* [new branch] XXXXX -> Origin/xxxxx

check the remote warehouse again, Display the corresponding clone address
git remote – V
– origin git://github.com/schacon/ticgit.git (fetch)
origin git://github.com/schacon/ticgit.git (push)

then check the branch
git branch – a

– * mate

remotes/origin/XXXXXX ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ https://blog.csdn.net/tanningzhong/article/de Tails/79724488

git renames the warehouse, modifies the remote warehouse address To modify the warehouse configuration, please refer to: https://blog.csdn.net/u011884440/article/details/71246572

———————
Author: huanhuaqian
source: CSDN
original text: https://blog.csdn.net/huanhuaqian/article/details/81986064
Copyright notice: This article is the original article of the blogger, please attach the blog link if you reprint it

Similar Posts: