我有个仓库,需要推送到 Github 和 Notabug 上。现在想要根据不同托管平台上的远程仓库,推送不同内容(主要是各种超链接不同)的 README ,有什么方法可以做到吗?
我有个仓库,需要推送到 Github 和 Notabug 上。现在想要根据不同托管平台上的远程仓库,推送不同内容(主要是各种超链接不同)的 README ,有什么方法可以做到吗?
|
unifierFeb 26, 2022
1
做两个分支,然后在不同平台上设置不同的默认分支?
|
|
foamFeb 26, 2022 via Android
2
readme 不要放本地 git 就行了。在远程仓库管理
|
|
foamFeb 26, 2022 via Android
3
sorry ,忽略了 git pull 会有问题。那方案就复杂点了:
1 ,弄个不在 git 管理的目录,放多个 readme 2 ,分支: master ,分支 g ,分支 n 3 ,推送时,分支 g n rebase master 分支,并分别 cp 对应的 readme ,push 到对应的远程即可 以上这些命令自动化就行,弄个别名,简单方便。 P.S. 为啥要区分 readme ? |
|
4
|
|
0o0O0o0O0oFeb 26, 2022
5
如果主要使用 Github ,那 git hooks 里对别的平台 sed + commit + force push + reset 不知道行不行
|
|
J55s5Feb 26, 2022
6
1 楼的方法应该是正解,只能维护俩分支了
|
|
7
用相对路径试试?
A relative link is a link that is relative to the current file. For example, if you have a README file in root of your repository, and you have another file in docs/CONTRIBUTING.md, the relative link to CONTRIBUTING.md in your README might look like this: [Contribution guidelines for this project](docs/CONTRIBUTING.md) GitHub will automatically transform your relative link or image path based on whatever branch you're currently on, so that the link or path always works. You can use all relative link operands, such as ./ and ../. https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes |
|
SenorsenFeb 26, 2022
8
ls 方案+1.
又是个 XY Problem |