Git BASH 作業履歴 2022/10/21 / P13 pagerankingなど(Third-Ranking-Service) / 入力順番を間違えたためグダグダになってしまった例

GitGit BASH

目次一覧

 状態:-  閲覧数:322  投稿日:2022-10-21  更新日:2022-10-21
次回検証 / 入力順番を間違えたためグダグダになってしまった例

次回検証 / 入力順番を間違えたためグダグダになってしまった例

 閲覧数:80 投稿日:2022-10-21 更新日:2022-10-21

次回検証


正しい順番は恐らく下記
次回検証予定

1.
$ cd /L/1_Hp/0_sakura/2018server/var/www/html/1-p13

2.
$ git init
Initialized empty Git repository in L:/1_Hp/0_sakura/2018server/var/www/html/1-p
13/.git/


3.
$ git remote add origin git@github.com:GitHubユーザー名/P13-Third-Ranking-Service.git

4.
$ git add -A

5.
$ git commit -m "first commit"
[main cde055a] first commit
 1550 files changed, 69525 insertions(+)
 create mode 100644 0webapp/LICENSE
 create mode 100644 0webapp/MiniBlogApplication.php



必要かどうか要検証
→ 必要でした。
$ 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), 640 bytes | 5.00 KiB/s, done.
From github.com:GitHubユーザー名/P13-Third-Ranking-Service
 * [new branch]      main       -> origin/main


6
$ git merge --allow-unrelated-histories origin/main

7
$ git push origin main
Enumerating objects: 1121, done.
Counting objects: 100% (1121/1121), done.
Delta compression using up to 8 threads
Compressing objects: 100% (1104/1104), done.
Writing objects: 100% (1120/1120), 142.63 MiB | 3.30 MiB/s, done.
Total 1120 (delta 105), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (105/105), done.
To github.com:GitHubユーザー名/P13-Third-Ranking-Service.git
   a37f25e..cde055a  main -> main


10.配置

11
$ git add -A

12
(main)
$ git commit -m "SQL dumpdata"
[main 0c9e7f9] SQL dumpdata
2 files changed, 1035 insertions(+)
create mode 100644 ibj_pagerankin.sql
create mode 100644 ibj_siterankin.sql


13
(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), 206.32 KiB | 1.88 MiB/s, done.
Total 4 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To github.com:GitHubユーザー名/P13-Third-Ranking-Service.git
  cde055a..0c9e7f9  main -> main


20.配置

21
$ git add -A

22
(main)
$ git commit -m "Screen capture"
[main ecc78f7] Screen capture
4 files changed, 79386 insertions(+)


23
(main)
$ git push origin main
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 8 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 774.81 KiB | 6.51 MiB/s, done.
Total 6 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), done.
To github.com:GitHubユーザー名/P13-Third-Ranking-Service.git
  0c9e7f9..ecc78f7  main -> main



入力順番を間違えたためグダグダになってしまった例


「$ git init」後いきなりコミットしたため、GitHubでレポジトリを作成する時に「README.md」追加した「Initial commit」とuserが異なると言っている?
とにかく入力順番を間違えると見たことがないエラーが表示される可能性があるため、要注意。
$ git init
Initialized empty Git repository in L:/1_Hp/0_sakura/2018server/var/www/html/1-p
13/.git/


$ git commit -m "first commit"
fatal: detected dubious ownership in repository at 'L:/1_Hp/0_sakura/2018server/
var/www/html/1-p13'
'L:/1_Hp/0_sakura/2018server/var/www/html/1-p13' is owned by:
       '▲▲'
but the current user is:
       '△△'
To add an exception for this directory, call:

       git config --global --add safe.directory L:/1_Hp/0_sakura/2018server/var
/www/html/1-p13


$ git config --global --add safe.directory L:/1_Hp/0_sakura/2018server/var
/www/html/1-p13
bash: /www/html/1-p13: No such file or directory


$ git config --global --add safe.directory L:/1_Hp/0_sakura/2018server/var/www/html/1-p13

(main)
$ git commit -m "first commit"
On branch main

Initial commit

Untracked files:
 (use "git add <file>..." to include in what will be committed)
       0webapp/
       favorite/
       ■■/
       pageranking/
       □□/

nothing added to commit but untracked files present (use "git add" to track)

(main)
$ git remote -v

(main)
$ git remote add origin git@github.com:GitHubユーザー名/P13-Third-Ranking-Service.git

(main)
$ git push origin main
error: src refspec main does not match any
error: failed to push some refs to 'github.com:GitHubユーザー名/P13-Third-Ranking-Service.git'

(main)
$ git merge --allow-unrelated-histories origin/main
merge: origin/main - not something we can merge

(main)
$ git push origin main
error: src refspec main does not match any
error: failed to push some refs to 'github.com:GitHubユーザー名/P13-Third-Ranking-Service.git'

(main)
$ git remote -v
origin  git@github.com:GitHubユーザー名/P13-Third-Ranking-Service.git (fetch)
origin  git@github.com:GitHubユーザー名/P13-Third-Ranking-Service.git (push)

(main)
$ git branch

(main)
$ git branch

(main)
$ git branch

(main)
$ git status
On branch main

No commits yet

Untracked files:
 (use "git add <file>..." to include in what will be committed)
       0webapp/
       favorite/
       ■■/
       pageranking/
       □□/

nothing added to commit but untracked files present (use "git add" to track)

(main)
$ git commit -m "first commit"
On branch main

Initial commit

Untracked files:
 (use "git add <file>..." to include in what will be committed)
       0webapp/
       favorite/
       ■■/
       pageranking/
       □□/

nothing added to commit but untracked files present (use "git add" to track)

(main)
$ git add -A

(main)
$ git push origin main
error: src refspec main does not match any
error: failed to push some refs to 'github.com:GitHubユーザー名/P13-Third-Ranking-Service.git'

(main)
$ git merge --allow-unrelated-histories origin/main
merge: origin/main - not something we can merge

(main)
$ git push origin main
error: src refspec main does not match any
error: failed to push some refs to 'github.com:GitHubユーザー名/P13-Third-Ranking-Service.git'

(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), 640 bytes | 5.00 KiB/s, done.
From github.com:GitHubユーザー名/P13-Third-Ranking-Service
* [new branch]      main       -> origin/main

(main)
$ git push origin main
error: src refspec main does not match any
error: failed to push some refs to 'github.com:GitHubユーザー名/P13-Third-Ranking-Service.git'

(main)
$ git merge
fatal: No remote for the current branch.

(main)
$ git merge --allow-unrelated-histories origin/main

(main)
$ git push origin main
Everything up-to-date

(main)
$ git log
commit a37f25e68fac30d5d2055e060720fda503e8257c (HEAD -> main, origin/main)
Author: GitHubユーザー名 <GitHubユーザー名@users.noreply.github.com>
Date:   Fri Oct 21 00:00:21 2022 +0900

   Initial commit

(main)
$ git push origin main
Everything up-to-date

(main)
$ git log
commit a37f25e68fac30d5d2055e060720fda503e8257c (HEAD -> main, origin/main)
Author: GitHubユーザー名 <GitHubユーザー名@users.noreply.github.com>
Date:   Fri Oct 21 00:00:21 2022 +0900

   Initial commit

(main)
$ git add -A

(main)
$ git commit -m "first commit"
[main cde055a] first commit
1550 files changed, 69525 insertions(+)
create mode 100644 0webapp/LICENSE
create mode 100644 0webapp/MiniBlogApplication.php
$ git push origin main
Enumerating objects: 1121, done.
Counting objects: 100% (1121/1121), done.
Delta compression using up to 8 threads
Compressing objects: 100% (1104/1104), done.
Writing objects: 100% (1120/1120), 142.63 MiB | 3.30 MiB/s, done.
Total 1120 (delta 105), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (105/105), done.
To github.com:GitHubユーザー名/P13-Third-Ranking-Service.git
  a37f25e..cde055a  main -> main



Git BASH 作業履歴 2022/10/20 / P25 manga-user-ranking(Second-Ranking-Service) / 「Add a README」後「git merge --allow-unrelated-histories origin/main」実行して、「README」もコミット履歴に含める

意図せずSubModule(ディレクトリに白い矢印)が作成された場合は、「$ git rm -rf --cached <対象ファイル or path>」後、「$ git add <対象ファイル or path>」



類似度ページランキング
順位 ページタイトル抜粋
1 Git BASH 作業履歴 2022/10/21 / P13 pagerankingなど(Third-Ranking-Service) / 入力順番を間違えたためグダグダになってしまった例 59
2 Git BASH 作業履歴 2022/10/21 / P28 site-ranking(4Th-Ranking-Service) / 他の「.git」ディレクトリが存在した状態のまま下記gitコマンドを実行したため、意図せず「submodule」化されてしまった例 36
3 Git BASH 作業履歴 2022/10/20 / P48 site-rank(First-Ranking-Service) / 「Add a README」後「git push -f origin main」実行したため、「README」削除 33
4 Git BASH 作業履歴 2022/10/20 / P48 site-rank(First-Ranking-Service) 2 / P25をP48のリポジトリへ反映させていたので、「git push -f origin main」で強制上書き実行 32
5 Git BASH 作業履歴 2022/10/20 / P25 manga-user-ranking(Second-Ranking-Service) / 「Add a README」後「git merge --allow-unrelated-histories origin/main」実行して、「README」もコミット履歴に含める 28
6 Git 失敗履歴2。「$ git reset」→ ソースコード削除。※Git BASH 経由で Windows10 から GitHub へ PUSH しようとするも、誤ってソースコードを削除してしまう 25
7 「Twitter Developer」審査結果に通り、appを作成。しかし、いつの間にか「User is not Authorized」が表示されていたケース 23
8 「2023 年 4 月 30 日」前後にTwitterアカウントが「SUSPENDED This App has violated Twitter Rules and policies.」と表示された場合には、「Downgrade」ボタンを押した方がよいと思われます。 23
9 「Twitter API」は、2023 年 5 月 10 日時点では、SMS認証(電話番号登録)不要でプロジェクト作成できるよう仕様変更されています。 22
10 「Twitter API」を利用するためには? / Twitter API v1.1 / OAuth 1.0A / OAuth 2.0 22
11 Twitter連携ログイン代替APIを探しています 20
12 旧 Twitter API 分類 / REST APIs / Streaming APIs 20
13 You currently have access to a subset of Twitter API v2 endpoints 20
14 「Twitter Developers」でアプリケーションを新規作成するためには? SMS認証用コードを確認可能な電話番号の登録が必要 20
15 Git BASH 経由で、Windows10 から GitHub へ PUSH する 19
16 GitHubのリポジトリ名を変更するためには、GitHubのWebページへアクセス。[Repositories] - [Settings]タブをクリック後、[Repository name]へ入力後、[Rename]ボタンをクリックする 19
17 Twitter API 1.0 18
18 Twitter API v1.1 18
19 「Windows10」へ「gitfor windows VERSION 2.18.0」をインストール 18
20 「Windows10」へ「gitfor windows VERSION 2.22.0」をインストール 18
2024/4/26 8:07 更新