プロジェクト新規作成 / プロジェクト追加作成

カテゴリー: Git BASH  閲覧数:202 配信日: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


週間人気ページランキング / 6-30 → 7-6
順位 ページタイトル抜粋 アクセス数
1 開発 0 3
2 ログイン 2
3 Twitter 回答を得られたQ | Twitter Developer(Twitter) 1
3 フォルダ/ファイル構成 | プログラミング 1
3 意図せずSubModule(ディレクトリに白い矢印)が作成された場合は、「$ git rm -rf --cached <対象ファイル or path>」後、「$ git add <対象ファイル or path>」 | Git BASH(Git) 1
3 ANRIとは? / ジェネラルパートナー株式会社 1
3 Twitter 電話番号の問題 | Twitter Developer(Twitter) 1
3 「お問い合わせフォームの日本語」をどう書けば良いかが分からない | 言葉(Webサービス開発) 1
3 Git Bash で異なるディレクトリの指定ディレクトリへ移動する。「$ cd /L/3_開発/git/大阪府」 | Git BASH(Git) 1
3 同じ携帯電話番号でも、複数の「Twitter Developers」アカウントを作成可能 | Twitter Developer(Twitter) 1
3 「Windows10」へ「gitfor windows VERSION 2.22.0」をインストール | GitHub(Git) 1
3 「Twitterデータ」対応 | Twitter Developer(Twitter) 1
3 Twitter API v1.1 / OAuth 1.0A / OAuth 2.0 1
3 Git 失敗履歴2。「$ git reset」→ ソースコード削除。※Git BASH 経由で Windows10 から GitHub へ PUSH しようとするも、誤ってソースコードを削除してしまう | Git BASH(Git) 1
3 Windows10で使用できるGitクライアント | GitHub(Git) 1
3 TwitterOAuth では、画像URL を指定した画像投稿は出来ない(と思う)。ライブラリを使用しなければ出来るから、Twitter API の制限ではない(と思われる)  | Twitter 1
3 teratailでは質問しない | プログラミング 1
3 ゲストコメント一覧ページ 1
3 fatal: remote error: is not a valid repository name | Git BASH(Git) 1
3 2022 年 10 月 28 時点における、私が理想とする(Web系プロジェクトバックアップ用途)gitコマンド実行履歴。※これまで一度もこの通りに実行できたことはない | Git BASH(Git) 1
2025/7/7 1:02 更新
指定期間人気ページランキング / 2020-5-27 → 2025-7-6
順位 ページタイトル抜粋 アクセス数
1 GitHubリモートリポジトリ名には日本語を使用できない。使用すると、ハイフンへ自動置換されてしまう | GitHub(開発環境) 1036
2 fatal: remote error: is not a valid repository name | Git BASH(開発環境) 738
3 Twitter アカウント管理 | Twitter Developer(Twitter) 617
4 Twitter API | Twitter API (Twitter) 591
5 動画対応 | プログラミング 589
6 開発 0 588
7 「Twitterデータ」対応 | Twitter Developer(Twitter) 554
8 Windows10で使用できるGitクライアント | GitHub(開発環境) 447
9 本 | ブックマーク 445
10 Webサービス | ブックマーク 422
11 マッチングサービス | Webサービスビジネス 403
12 同じ携帯電話番号でも、複数の「Twitter Developers」アカウントを作成可能 | Twitter Developer(Twitter) 355
13 TwitterOAuth では、画像URL を指定した画像投稿は出来ない(と思う)。ライブラリを使用しなければ出来るから、Twitter API の制限ではない(と思われる)  | Twitter 320
14 技術書籍 | プログラミング 299
15 teratailでは質問しない | プログラミング 295
16 気になった動画 | ブックマーク 292
17 埋め込みツイート | Twitter Developer(Twitter) 271
18 個人事業主 | Webサービスビジネス 250
19 Twitter 電話番号の問題 | Twitter Developer(Twitter) 232
20 コインチェック株式会社   | Webサービスビジネス 201
2025/7/7 1:02 更新