fukasawamoe / yoriyoi

1 stars 0 forks source link

コンフリクトが起きる #41

Closed fukasawamoe closed 1 year ago

fukasawamoe commented 1 year ago

いつもお世話になっております。 40期の深澤です。

git pushでプルリクエストが表示されてマージができるようにしたいです。

git push後にpull requestがgithub上に表示されなかったため

色々いじってしまい、revertをしてしまいました。

その後からコンフリクトの連発で、

現在は新しいブランチを作成したgit pull origin main を行ってから 修正を行い

git add .

git commit -m “~~

% git push origin mainとしたところでリジェクトされてしまいました。

% git push --set-upstream origin home1
To https://github.com/fukasawamoe/yoriyoi.git
 ! [rejected]        home1 -> home1 (non-fast-forward)
error: failed to push some refs to 'https://github.com/fukasawamoe/yoriyoi.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.

hint: 'git pull ...') before pushing again.の部分はすでに新しいブランチを切り、mainブランチからpullを行っているので問題ないと思います

hint: See the 'Note about fast-forwards'についてもサイト通りに行ったのにも関わらず状況の変化なしです

% 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=<remote>/<branch> home1

fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git branch --set-upstream-to=origin/main home1
branch 'home1' set up to track 'origin/main'.
fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git pull
Already up to date.
fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git push --set-upstream origin home1          
To https://github.com/fukasawamoe/yoriyoi.git
 ! [rejected]        home1 -> home1 (non-fast-forward)
error: failed to push some refs to 'https://github.com/fukasawamoe/yoriyoi.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.
fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git fetch origin
fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git merge origin home1
Already up to date.
fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git merge origin main 
Already up to date.

お手数をおかけいたしますがどうぞよろしくお願いします。

kenchasonakai commented 1 year ago

force pushしちゃうのが早いかもですね

fukasawamoe commented 1 year ago

コメントありがとうございます。

挙げていただいた方法でなんとかしようとしてみたのですが….

Everything up-to-dateとでたのでpushを行ったところできるようになりました。

fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git push --force origin main      
Everything up-to-date
fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git push -f origin main  
Everything up-to-date
fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git status             
On branch home1
Your branch is ahead of 'origin/main' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git push               
fatal: The upstream branch of your current branch does not match
the name of your current branch.  To push to the upstream branch
on the remote, use

    git push origin HEAD:main

To push to the branch of the same name on the remote, use

    git push origin HEAD

To choose either option permanently, see push.default in 'git help config'.

To avoid automatically configuring upstream branches when their name
doesn't match the local branch, see option 'simple' of branch.autoSetupMerge
in 'git help config'.

fukasawamoe (arm64):~/workspace/RUNTEQ/PF/生活/yoriyoi
% git push origin HEAD:main
Enumerating objects: 35, done.
Counting objects: 100% (35/35), done.
Delta compression using up to 8 threads
Compressing objects: 100% (19/19), done.
Writing objects: 100% (19/19), 2.72 KiB | 2.72 MiB/s, done.
Total 19 (delta 15), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (15/15), completed with 15 local objects.
To https://github.com/fukasawamoe/yoriyoi.git
   4f93e64..749c6c9  HEAD -> main

しかし、pull requestが表示されず、

Image from Gyazo 自分でpull requestをあげようとしたのですが

Image from Gyazo Image from Gyazo

またrevertの文字が出てきてしまってこのまま進めていいものか困っています…。

Image from Gyazo

ご助言いただけると幸いです。

fukasawamoe commented 1 year ago

お世話になっております。 ありがとうございました!なんとか自己解決しました🙇‍♀️💦 一応このまま様子を見てみようと思います!