カテゴリー:
Git BASH
閲覧数:142 配信日:2022-10-21 02:08
プロジェクト新規作成
1
(main)
$ cd /L/1_Hp/0_sakura/2018server/var/www/html/p-28
2
$ git init
Initialized empty Git repository in L:/1_Hp/0_sakura/2018server/var/www/html/p-28/.git/
3
順調なのは、ここまでだった。
(main)
$ git remote add origin git@github.com:GitHubユーザー名/P28-4th-Ranking-Service.git
迷1
他の「.git」ディレクトリが存在した状態のまま下記gitコマンドを実行したため、意図せず「submodule」化されてしまう
(main)
$ git add -A
warning: adding embedded git repository: △△
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint: git submodule add <url> △△
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint: git rm --cached △△
hint:
hint: See "git help submodule" for more information.
迷2
ここで、「.git」ディレクトリを手動削除後、再度下記コマンドを実行したが、多分この処理が誤り。
(未確認だけれども恐らく)既に「submodule」化されているのだから、後で実行している「$ git rm -rf --cached △△」を「$ git add -A」の前に実行した方が良かったと思われ。
(main)
$ git add -A
(main)
$ git commit -m "first commit"
[main (root-commit) b626c3b] first commit
119 files changed, 33294 insertions(+)
create mode 100644 0webapp/LICENSE
create mode 100644 0webapp/MiniBlogApplication.php
「$ git fetch」不要かと思ったが、必要みたい。
(main)
$ git merge --allow-unrelated-histories origin/main
merge: origin/main - not something we can merge
(main)
$ git fetch
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 637 bytes | 6.00 KiB/s, done.
From github.com:GitHubユーザー名/P28-4th-Ranking-Service
* [new branch] main -> origin/main
(main)
$ git merge --allow-unrelated-histories origin/main
Merge made by the 'ort' strategy.
README.md | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 README.md
(main)
$ git push origin main
Enumerating objects: 117, done.
Counting objects: 100% (117/117), done.
Delta compression using up to 8 threads
Compressing objects: 100% (114/114), done.
Writing objects: 100% (116/116), 170.32 KiB | 1.08 MiB/s, done.
Total 116 (delta 26), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (26/26), done.
To github.com:GitHubユーザー名/P28-4th-Ranking-Service.git
5a53ab5..76ceace main -> main
(main)
$ git rm -rf --cached △△
rm '△△'
(main)
$ git add -A
(main)
$ git commit -m "public_html 以下"
[main 3fb24ef] public_html 以下
597 files changed, 122353 insertions(+), 1 deletion(-)
(main)
$ git push origin main
Enumerating objects: 619, done.
Counting objects: 100% (619/619), done.
Delta compression using up to 8 threads
Compressing objects: 100% (599/599), done.
Writing objects: 100% (618/618), 109.27 MiB | 3.31 MiB/s, done.
Total 618 (delta 60), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (60/60), completed with 1 local object.
To github.com:GitHubユーザー名/P28-4th-Ranking-Service.git
76ceace..3fb24ef main -> main
プロジェクト追加作成
10.配置
今回は「SQL dumpdata」を配置。
11
(main)
$ git add -A
12
(main)
$ git commit -m "SQL dumpdata"
[main ebcbce8] SQL dumpdata
1 file changed, 682 insertions(+)
create mode 100644 mode_siterankin.sql
13
(main)
$ git push origin main
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 20.23 KiB | 1.01 MiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To github.com:GitHubユーザー名/P28-4th-Ranking-Service.git
3fb24ef..ebcbce8 main -> main
20.配置
今回は「スクリーンキャプチャ」を配置。
21
(main)
$ git add -A
22
(main)
$ git commit -m "Screen capture"
[main a6a38fc] Screen capture
2 files changed, 31542 insertions(+)
23
(main)
$ git push origin main
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 319.44 KiB | 3.76 MiB/s, done.
Total 4 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To github.com:GitHubユーザー名/P28-4th-Ranking-Service.git
ebcbce8..a6a38fc main -> main