Cannot remove remote origin

前端 未结 3 1427
你的背包
你的背包 2020-12-04 14:33

I\'m running git 1.8.0 on OS X, and every new git repo seems to have a remote called \"origin\":

$ git init
$ git remote
origin

What\'s odd

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 14:55

    I solved my problems this way. First I opened up the config file using vim with the following command

    $ vim .git/config
    

    I modified my file to this below:

    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
            ignorecase = true
            precomposeunicode = false
    [branch "master"]
    [remote "origin"]
            url = git@192.168.200.79:xxx.git
            fetch = +refs/heads/*:refs/remotes/origin_iOS/*
    

    So now, when I give a command git push it understands, because by default it pushed to origin and it is set to my origin_iOS in my server.

    You can check your origin config by remote -v command:

    $ git remote -v
    origin  git@192.168.200.79:xxxx.git (fetch)
    origin  git@192.168.200.79:xxx.git (push)
    

    If you don't have 'origin', you will have troubles with a usual 'git push' as I did. I had to type 'git push origin_iOS master', because I had in my config 'origin_iOS'

提交回复
热议问题