Notebook
これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。
HTML ファイル生成日時: 2026/04/23 21:46:11.238 (台灣標準時)
git repository を別の計算機に移す方法
ある計算騎上にある git repository を別の計算機に移す方法につい調べて、
試してみたでござる。
まず、移す先の計算機に空の repository を作っておくでござる。
% cd /some/where/in/the/disk
% mkdir myrepository.git
% cd myrepository.git
% git init --bare
hint: Using 'master' as the name for the initial branch. This default branch name
hint: will change to "main" in Git 3.0. To configure the initial branch name
hint: to use in all of your new repositories, which will suppress this warning,
hint: call:
hint:
hint: git config --global init.defaultBranch
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"
Initialized empty Git repository in /some/where/in/the/disk/myrepository.git
% ls
HEAD description info/ refs/
config hooks/ objects/
次に、 --mirror オプションをつけて git clone を
行うでござる。
% cd /tmp
% git clone --mirror ssh://123.45.67.89:12345/home/git/repo/myrepository
Cloning into bare repository 'myrepository.git'...
remote: Enumerating objects: 328, done.
remote: Counting objects: 100% (328/328), done.
remote: Compressing objects: 100% (307/307), done.
remote: Total 328 (delta 174), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (328/328), 51.31 KiB | 761.00 KiB/s, done.
Resolving deltas: 100% (174/174), done.
--mirror オプション付きで git push して、新しい
場所に repository を移すでござる。
% cd myrepository.git
% ls
HEAD description info/ packed-refs
config hooks/ objects/ refs/
% git push --mirror /some/where/in/the/disk/myrepository.git
Enumerating objects: 328, done.
Counting objects: 100% (328/328), done.
Delta compression using up to 4 threads
Compressing objects: 100% (133/133), done.
Writing objects: 100% (328/328), 51.31 KiB | 4.66 MiB/s, done.
Total 328 (delta 174), reused 328 (delta 174), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (174/174), done.
To /some/where/in/the/disk/myrepository.git
* [new branch] master -> master
- About this article:
- author: daisuke
- file: 20260423_00.html
- category: Computer___NetBSD
- title: git repository を別の計算機に移す方法
- mode: public
- last modified: 2026/04/23 21:36:38 (UT+08:00)
- html generated: 2026/04/23 21:46:11.238 (Taiwan Standard Time)
Frequently accessed files
- Misc___Taiwan/20240207_00.html
- 2007 page views
- title: 台灣から台灣の外に EMS で荷物を発送する方法
- Misc___Taiwan/20240819_00.html
- 1449 page views
- title: 住所から台灣の郵便番号を調べる方法
- Computer___TeX/20231107_00.html
- 1089 page views
- title: LaTeX での counter の利用方法について
- Book___Chinese/20240424_00.html
- 1011 page views
- title: 曹操の詩
- Computer___TeX/20230726_01.html
- 774 page views
- title: Beamer の Metropolis テーマで block の色を変える方法
- Computer___Network/20260127_00.html
- 766 page views
- title: radiko の API に変更があった
- Computer___NetBSD/20250301_01.html
- 763 page views
- title: yt-dlp で YouTube の動画をダウンロードするときのこと
- Computer___TeX/20240411_00.html
- 722 page views
- title: LuaTeX を使って PDF ファイルを作成する方法
- Computer___TeX/20240414_01.html
- 681 page views
- title: LuaTeX を使って日本語と中国語の漢字が混在した PDF ファイルを作成する方法
- Computer___Network/20230516_00.html
- 634 page views
- title: OpenVPN 2.6 を使い VPN Gate に接続するときの注意点
- Misc___Taiwan/20240903_01.html
- 618 page views
- title: 台湾の郵便局で EMS を利用して荷物を海外に送る方法
- Computer___Network/20241214_00.html
- 610 page views
- title: Google Colab で Python 3.12 を使う方法
- Misc___Japan/20240610_00.html
- 607 page views
- title: NHK ラジオの「聞き逃し」の変更点 (2024 年 06 月)
- Misc___Japan/20240718_00.html
- 581 page views
- title: 日本の運転免許証が失効してしまったときの再取得の手続きについて
- Computer___NetBSD/20230119_00.html
- 576 page views
- title: NetBSD でバイナリーパッケージを利用する方法
- Computer___Network/20240130_00.html
- 564 page views
- title: Google Colaboratory で Python 3.12 を使う方法
- Computer___FreeBSD/20220621_0.html
- 527 page views
- title: FreeBSD での X.org の設定の仕方
- Computer___TeX/20240410_00.html
- 507 page views
- title: pdfTeX を使って PDF ファイルを作る方法
- Computer___TeX/20240414_00.html
- 478 page views
- title: LuaTeX での fontspec を使ったフォントの設定の方法
- Computer___Python/20250330_00.html
- 462 page views
- title: Jupyter Notebook で Matplotlib を使うときのこと
- Computer___NetBSD/20250307_00.html
- 458 page views
- title: uim と mozc による日本語入力の設定について
- Computer___NetBSD/20240805_03.html
- 454 page views
- title: NetBSD 10 のインストール
- Computer___NetBSD/20250113_00.html
- 440 page views
- title: TigerVNC での X server の解像度の指定について
- Computer___Network/20220413_1.html
- 424 page views
- title: HTML 文書の中の一部の文字を点滅させる方法
- Computer___Python/20220518_0.html
- 422 page views
- title: Matplotlib で作る図の縦横比
- Computer___NetBSD/20220818_1.html
- 415 page views
- title: Emacs の markdown-mode について
- Computer___TeX/20230503_00.html
- 404 page views
- title: LaTeX CJK で日本語や中国語を取り扱うための準備について
- Computer___Python/20240101_00.html
- 403 page views
- title: Matplotlib の 3D plot においての注意点
- Computer___NetBSD/20241102_00.html
- 399 page views
- title: ImageMagick の convert コマンドについて
- Computer___Hardware/20240820_00.html
- 396 page views
- title: Raspberry Pi 5 の演算性能
HTML file generated by Kinoshita Daisuke.