git: how to fetch only master? on my device
by jindam vani from LinuxQuestions.org on (#6CQE1)
unable to express clearly, hence details
fetch master branch only from fdroiddata on every git fetch
* fork_ web interface from https://gitlab.com/fdroid/fdroiddata.git to https://gitlab.com/jindam.vani/metadata.git
* removed all branches except master after forking
* commands on my device:
Code:git clone https://gitlab.com/jindam.vani/metadata.git
git config --global user.email "u@v.w"
git config --global user.name "g.h"
git config --global pull.rebase "true"
cd metadata
git remote add metadata https://gitlab.com/fdroid/fdroiddata.git* i dont want to download branches: "2887-fatal-couldn-t-...", "test-issuebot", "test-issuebot-2"
Code:$ git checkout master && git fetch metadata && git merge metadata/master && git push origin master
Already on 'master'
Your branch is up to date with 'origin/master'.
remote: Enumerating objects: 64, done.
remote: Counting objects: 100% (60/60), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 34 (delta 25), reused 15 (delta 8), pack-reused 0
Unpacking objects: 100% (34/34), 5.25 KiB | 13.00 KiB/s, done.
From https://gitlab.com/fdroid/fdroiddata
* [new branch] 2887-fatal-couldn-t-find-remote-ref-xxx-master -> metadata/2887-fatal-couldn-t-find-remote-ref-xxx-master
* [new branch] master -> metadata/master
* [new branch] test-issuebot -> metadata/test-issuebot
* [new branch] test-issuebot-2 -> metadata/test-issuebot-2
Updating d8896ab320..c722763b7d
Fast-forward
metadata/app.alextran.immich.yml | 37 +++++++++-
metadata/com.appmindlab.nano.yml | 11 ++-
...ojski.soft.towercollector.yml | 2 +-
3 files changed, 45 insertions(+), 5 deletions(-)* output of git remote
Code:metadata https://gitlab.com/fdroid/fdroiddata.git (fetch)
metadata https://gitlab.com/fdroid/fdroiddata.git (push)
origin https://gitlab.com/jindam.vani/metadata.git (fetch)
origin https://gitlab.com/jindam.vani/metadata.git (push)* output of git branch -r
Code:metadata/2887-fatal-couldn-t-find-remote-ref-xxx-master
metadata/master
metadata/test-issuebot
metadata/test-issuebot-2
origin/HEAD -> origin/master
origin/master
fetch master branch only from fdroiddata on every git fetch
* fork_ web interface from https://gitlab.com/fdroid/fdroiddata.git to https://gitlab.com/jindam.vani/metadata.git
* removed all branches except master after forking
* commands on my device:
Code:git clone https://gitlab.com/jindam.vani/metadata.git
git config --global user.email "u@v.w"
git config --global user.name "g.h"
git config --global pull.rebase "true"
cd metadata
git remote add metadata https://gitlab.com/fdroid/fdroiddata.git* i dont want to download branches: "2887-fatal-couldn-t-...", "test-issuebot", "test-issuebot-2"
Code:$ git checkout master && git fetch metadata && git merge metadata/master && git push origin master
Already on 'master'
Your branch is up to date with 'origin/master'.
remote: Enumerating objects: 64, done.
remote: Counting objects: 100% (60/60), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 34 (delta 25), reused 15 (delta 8), pack-reused 0
Unpacking objects: 100% (34/34), 5.25 KiB | 13.00 KiB/s, done.
From https://gitlab.com/fdroid/fdroiddata
* [new branch] 2887-fatal-couldn-t-find-remote-ref-xxx-master -> metadata/2887-fatal-couldn-t-find-remote-ref-xxx-master
* [new branch] master -> metadata/master
* [new branch] test-issuebot -> metadata/test-issuebot
* [new branch] test-issuebot-2 -> metadata/test-issuebot-2
Updating d8896ab320..c722763b7d
Fast-forward
metadata/app.alextran.immich.yml | 37 +++++++++-
metadata/com.appmindlab.nano.yml | 11 ++-
...ojski.soft.towercollector.yml | 2 +-
3 files changed, 45 insertions(+), 5 deletions(-)* output of git remote
Code:metadata https://gitlab.com/fdroid/fdroiddata.git (fetch)
metadata https://gitlab.com/fdroid/fdroiddata.git (push)
origin https://gitlab.com/jindam.vani/metadata.git (fetch)
origin https://gitlab.com/jindam.vani/metadata.git (push)* output of git branch -r
Code:metadata/2887-fatal-couldn-t-find-remote-ref-xxx-master
metadata/master
metadata/test-issuebot
metadata/test-issuebot-2
origin/HEAD -> origin/master
origin/master