Git merge single file from another repository into my own

后端 未结 4 732
耶瑟儿~
耶瑟儿~ 2020-12-31 13:08

Say I have my own git repo with a bunch of text files in it. There is another different git repo that someone else owns with a bunch of text files that all differ from my ow

4条回答
  •  说谎
    说谎 (楼主)
    2020-12-31 13:53

    Go to your current directory, This way I'm doing currently, I hope you will help too.

    cd your_current_git_Directory
    

    Set your username and repository of another repository/second(from want to copy)

    git remote add -f repo-b git@github.com:/.git
    

    Now, Merge the filename you looking for(if you want file merge subfolder)

    git checkout -p repo-b/master  /
    

    Or merge filename only

    git checkout -p repo-b/master  
    

    And Remove repository

    git remote rm repo-b
    

提交回复
热议问题