0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ひとりGit リポジトリ構成編

Posted at

プロローグ

前回の続き。
今回はリポジトリを作って状態を記録複製できるか確認してみる。

実行

はじめの状態

C:\work\git_practice\work>tree
フォルダー パスの一覧:  ボリューム Local Disk
ボリューム シリアル番号は FAFC-01FC です
C:.
├─local_r
└─remote_r.git

remoteリポジトリ作る

C:\work\git_practice\work\remote_r.git>git init --bare --shared
Initialized empty shared Git repository in C:/work/git_practice/work/remote_r.git/

クローンする

C:\work\git_practice\work>git clone remote_r.git local_r
Cloning into 'local_r'...
warning: You appear to have cloned an empty repository.
done.

ファイル作ってaddしてcommitしてpushする

C:\work\git_practice\work\local_r>copy nul test.txt
        1 個のファイルをコピーしました。

C:\work\git_practice\work\local_r>git add test.txt

C:\work\git_practice\work\local_r>git commit -m "test"
[master (root-commit) a226526] test
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test.txt

C:\work\git_practice\work\local_r>git push
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 198 bytes | 99.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To C:/work/git_practice/work/remote_r.git
 * [new branch]      master -> master

記録できたか確認する

C:\work\git_practice\work>mkdir local_r2
C:\work\git_practice\work>git clone remote_r.git local_r2
Cloning into 'local_r2'...
done.
C:\work\git_practice\work>cd local_r2
C:\work\git_practice\work\local_r2>dir
 ドライブ C のボリューム ラベルは Local Disk です
 ボリューム シリアル番号は FAFC-01FC です
 C:\work\git_practice\work\local_r2 のディレクトリ

2020/06/14  22:45    <DIR>          .
2020/06/14  22:45    <DIR>          ..
2020/06/14  22:45                 0 test.txt
               1 個のファイル                   0 バイト
               2 個のディレクトリ   2,364,313,600 バイトの空き領域

エピローグ

次はブランチ作って、mergeとかrebaseとかやっていく

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?