codeGoogleCom exported Wiki, how to merge it?

前端 未结 1 1485
盖世英雄少女心
盖世英雄少女心 2021-01-14 20:00

code.google.com is exporting all projects to Github... And when export, produce a separated branch named wiki for the Wiki of the project...

My proje

相关标签:
1条回答
  • 2021-01-14 20:42

    My project has only Wiki... Now, at Github,

    You could simply push your local wiki branch as the master of your GitHub repo

    git push --force -u origin wiki:master
    

    Don't forget though that each GitHub repo has a second "wiki" repo, as I mentioned in "Effortless export from GitHub wiki" (Just add ".wiki" to any repository name in the GitHub URL).
    That means you could also push to the wiki part of your (empty) GitHub repo.


    Independently of the "wiki" nature of the local repo, if you simply want to get your branch "on top" of the existing master GitHub repo, all you need to do is:

    cd /path/to/your/local/repo
    git remote set-url origin https://<yourName>@github.com/<yourname>/<yourrepo>
    git fetch
    git rebase origin master
    git push -u origin master
    

    complete procedure for dummies

    For a repo which already has a wiki branch (like ppKrauss/smallest-template-system has), you can replay it on top of master and then push to master:

    git clone https://github.com/ppKrauss/smallest-template-system.git
    cd smallest-template-system
    git checkout -b wiki origin/wiki
    #ls
    git rebase master
    #ls 
    git checkout master
    git reset --hard wiki
    git push
    

    Explain: the first checkout switch to the wiki branch and an ls will show only the branch files. The rebase git command do the "merge of files" here, the second ls will show the README file of the master branch.

    0 讨论(0)
提交回复
热议问题