12.ローカルリポジトリ(mainブランチ)(の変更)を送信して、リモートリポジトリ(「origin」上の同名ブランチ)へ反映させる / 迷走作業失敗履歴

カテゴリー: Git BASH  閲覧数:126 配信日:2022-10-20 23:45


ローカルリポジトリ(mainブランチ)(の変更)を送信して、リモートリポジトリ(「origin」上の同名ブランチ)へ反映させる



$ git push origin main
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 414.44 KiB | 6.19 MiB/s, done.
Total 5 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To github.com:GitHubユーザー名/P25-Second-Ranking-Service.git
  08bd5d3..aa8864c  main -> main



迷走作業失敗履歴


$ git push origin main
To github.com:GitHubユーザー名/P25-Second-Ranking-Service.git
! [rejected]        main -> main (fetch first)
error: failed to push some refs to 'github.com:GitHubユーザー名/P25-Second-Ranking-Service.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


$ git pull origin main
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ユーザー名/P25-Second-Ranking-Service
* branch            main       -> FETCH_HEAD
* [new branch]      main       -> origin/main
fatal: refusing to merge unrelated histories


$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

   git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

   git branch --set-upstream-to=origin/<branch> main


$ git log
commit 260333cb254bdd66b52557fa197e9498c3030d1b (HEAD -> main)
Author: GitHubユーザー名 <★★>
Date:   Thu Oct 20 21:43:05 2022 +0900

   first commit


$ git push origin main
To github.com:GitHubユーザー名/P25-Second-Ranking-Service.git
! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'github.com:GitHubユーザー名/P25-Second-Ranking-Service.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

   git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

   git branch --set-upstream-to=origin/<branch> main


$ git branch
* main


$ git pull main
fatal: 'main' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


$ git pull Default
f
atal: 'Default' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


$ git pull origin main
From github.com:GitHubユーザー名/P25-Second-Ranking-Service
* branch            main       -> FETCH_HEAD
fatal: refusing to merge unrelated histories


$ git pull origin branch
fatal: couldn't find remote ref branch


$ git pull branch
fatal: 'branch' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


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


$ git config --list
http.sslcainfo=L:/9.soft/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=manager-core
core.longpaths=true
core.autocrlf=false
core.fscache=true
core.symlinks=false
core.fsmonitor=true
pull.rebase=false
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=main
user.name=GitHubユーザー名
user.email=★★
core.autocrlf=false
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
safe.directory=L:/1_Hp/0_sakura/2018server/var
safe.directory=L:/1_Hp/0_sakura/2018server/var/www/html/1-p41
safe.directory=L:/9.soft/Git
difftool.sourcetree.cmd='' "$LOCAL" "$REMOTE"
mergetool.sourcetree.cmd=''
mergetool.sourcetree.trustexitcode=true
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=git@github.com:GitHubユーザー名/P25-Second-Ranking-Service.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*


$ git config remote.origin.url
git@github.com:GitHubユーザー名/P25-Second-Ranking-Service.git


$ git status
On branch main
nothing to commit, working tree clean


$ git branch -a
* main
 remotes/origin/main


$ git pull branch main
fatal: 'branch' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


$ git fetch

$ git merge origin/main
fatal: refusing to merge unrelated histories


$ git push origin main
To github.com:GitHubユーザー名/P25-Second-Ranking-Service.git
! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'github.com:GitHubユーザー名/P25-Second-Ranking-Service.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'github.com:GitHubユーザー名/P25-Second-Ranking-Service.git'


$ git log
commit 260333cb254bdd66b52557fa197e9498c3030d1b (HEAD -> main)
Author: GitHubユーザー名 <★★>
Date:   Thu Oct 20 21:43:05 2022 +0900

   first commit


$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

   git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

   git branch --set-upstream-to=origin/<branch> main


$ git branch --set-upstream-to=origin/<branch> main
bash: branch: No such file or directory


$ git branch --set-upstream-to=origin/ main
fatal: the requested upstream branch 'origin/' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
hint: Disable this message with "git config advice.setUpstreamFailure false"


$ git branch --set-upstream-to=origin/main
branch 'main' set up to track 'origin/main'.


$ git push origin main
To github.com:GitHubユーザー名/P25-Second-Ranking-Service.git
! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'github.com:GitHubユーザー名/P25-Second-Ranking-Service.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


$ git pull origin main
From github.com:GitHubユーザー名/P25-Second-Ranking-Service
* branch            main       -> FETCH_HEAD
fatal: refusing to merge unrelated histories


$ git pull origin branch
fatal: couldn't find remote ref branch


週間人気ページランキング / 4-26 → 5-2
順位 ページタイトル抜粋 アクセス数
1 動画対応 | プログラミング 6
2 開発 0 4
2 Twitter API v1.1 | Twitter Developer(Twitter) 4
3 GitHubリモートリポジトリ名には日本語を使用できない。使用すると、ハイフンへ自動置換されてしまう | GitHub(Git) 3
4 本 | ブックマーク 2
4 Twitter Developers からのメール   | Twitter Developer(Twitter) 2
4 Windows10で使用できるGitクライアント | GitHub(Git) 2
5 Twitter 旧レート制限 | Twitter API 旧仕様(Twitter) 1
5 感想履歴(技術エントリーを見返した際に不要だと感じた「当時の感想」をこのエントリーへ移動する) | Webサービス開発 1
5 Twitter 電話番号の問題 | Twitter Developer(Twitter) 1
5 2011年 1
5 fatal: remote error: is not a valid repository name | Git BASH(Git) 1
5 RTだけ表示するやつ / 2020/3/20時点の結論 / Link 1
5 理由 / 投稿削除できない / 質問の基準が不明 / QAサイトなのに、やってほしいことだけを記載してはいけない 1
5 同じ携帯電話番号でも、複数の「Twitter Developers」アカウントを作成可能 | Twitter Developer(Twitter) 1
5 Twitter API | Twitter API (Twitter) 1
5 統計 カテゴリー 1
5 問題発生 / 原因不明 / 原因を全く思いつかないがそれでは済ませられないので無理やり考えてみる 1
5 不動産 1
2024/5/3 1:01 更新
指定期間人気ページランキング / 2020-5-27 → 2024-5-2
順位 ページタイトル抜粋 アクセス数
1 GitHubリモートリポジトリ名には日本語を使用できない。使用すると、ハイフンへ自動置換されてしまう | GitHub(開発環境) 892
2 fatal: remote error: is not a valid repository name | Git BASH(開発環境) 654
3 Twitter アカウント管理 | Twitter Developer(Twitter) 601
4 動画対応 | プログラミング 572
5 Twitter API | Twitter API (Twitter) 564
6 「Twitterデータ」対応 | Twitter Developer(Twitter) 507
7 開発 0 479
8 本 | ブックマーク 430
9 Webサービス | ブックマーク 414
10 マッチングサービス | Webサービスビジネス 401
11 Windows10で使用できるGitクライアント | GitHub(開発環境) 370
12 同じ携帯電話番号でも、複数の「Twitter Developers」アカウントを作成可能 | Twitter Developer(Twitter) 297
13 技術書籍 | プログラミング 294
14 気になった動画 | ブックマーク 286
15 埋め込みツイート | Twitter Developer(Twitter) 269
16 TwitterOAuth では、画像URL を指定した画像投稿は出来ない(と思う)。ライブラリを使用しなければ出来るから、Twitter API の制限ではない(と思われる)  | Twitter 268
17 個人事業主 | Webサービスビジネス 250
18 teratailでは質問しない | プログラミング 246
19 Twitter 電話番号の問題 | Twitter Developer(Twitter) 205
20 過去の「0文字引用RT」を期間指定して取得しようとするも、挫折 | Twitter API (Twitter) 179
2024/5/3 1:01 更新