質問編集履歴
2
コードを入れるコンソールを変更して,行った操作.
test
CHANGED
File without changes
|
test
CHANGED
@@ -122,3 +122,37 @@
|
|
122
122
|
と試しに入れてもうまくいかなかった.
|
123
123
|
|
124
124
|
要約すると,```git add .```と```git merge```,``` git push origin main```で躓いてます.
|
125
|
+
|
126
|
+
最初,Windowsのコマンドプロントでやってましたが,Git CMDでもう一度試しましたが,同じようなエラーが出ました,そこでGit Bashでやりました.
|
127
|
+
|
128
|
+
すると,
|
129
|
+
|
130
|
+
```GitHub
|
131
|
+
git add .
|
132
|
+
```
|
133
|
+
|
134
|
+
すると,
|
135
|
+
|
136
|
+
```GitHub
|
137
|
+
fatal: detected dubious ownership in repository at 'H:/program/009_OpenRTM/GNG-Unk-Env-Navi_RTC-main'
|
138
|
+
'H:/program/009_OpenRTM/GNG-Unk-Env-Navi_RTC-main/.git' is owned by:
|
139
|
+
'S-数字7個'
|
140
|
+
but the current user is:
|
141
|
+
'S-すごく長い数字の列'
|
142
|
+
To add an exception for this directory, call:
|
143
|
+
|
144
|
+
git config --global --add safe.directory 'H:/program/009_OpenRTM/GNG-Unk-Env-Navi_RTC-main'
|
145
|
+
```
|
146
|
+
|
147
|
+
ユーザーの番号っぽいとこは消してます.
|
148
|
+
|
149
|
+
こんな感じのエラーがでました.
|
150
|
+
|
151
|
+
```GitHub
|
152
|
+
git config --global --add safe.directory 'H:/program/009_OpenRTM/GNG-Unk-Env-Navi_RTC-main'
|
153
|
+
```
|
154
|
+
と入力すると通ったので,
|
155
|
+
|
156
|
+
また,```git add .```から同じようにしました.
|
157
|
+
しかし,```push```のところで,同じようにエラーがでました.
|
158
|
+
|
1
試したことを加筆.
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,5 +32,93 @@
|
|
32
32
|
|
33
33
|
・ [追加したいサブモジュールのリポジトリ](https://github.com/sugarsweetrobotics/UrgRTC)
|
34
34
|
|
35
|
+
### 試したこと
|
35
36
|
|
37
|
+
この[サイト](https://grand-stream.com/github_upload)を参考にまず,既に作成済みのリポジトリと関連付けを行った.
|
36
38
|
|
39
|
+
この時,
|
40
|
+
```GitHub
|
41
|
+
git add .
|
42
|
+
```
|
43
|
+
と入力すると,
|
44
|
+
```GitHub
|
45
|
+
warning: in the working copy of 'Destination_gen/RTC.xml', LF will be replaced by CRLF the next time Git touches it
|
46
|
+
warning: in the working copy of 'FuzzyControl/RTC.xml', LF will be replaced by CRLF the next time Git touches it
|
47
|
+
warning: in the working copy of 'FuzzyControl/src/controller.cpp', LF will be replaced by CRLF the next time Git touches it
|
48
|
+
warning: in the working copy of 'GNG_component/RTC.xml', LF will be replaced by CRLF the next time Git touches it
|
49
|
+
.
|
50
|
+
.
|
51
|
+
.
|
52
|
+
```
|
53
|
+
こんな感じのエラーが大量にでた.
|
54
|
+
|
55
|
+
分からなかったので,ほかの操作を続け,
|
56
|
+
```GitHub
|
57
|
+
git push origin master
|
58
|
+
```
|
59
|
+
```GitHub
|
60
|
+
error: src refspec master does not match any
|
61
|
+
error: failed to push some refs to 'https://github.com/yukimeat1999/GNG-Unk-Env-Navi_RTC.git'
|
62
|
+
```
|
63
|
+
|
64
|
+
この[サイト](https://blog.deepblue-ts.co.jp/git/git-push-error/)によると,今は```master```ではなく```main```となってるらしいので,mainで実行すると,
|
65
|
+
|
66
|
+
```GitHub
|
67
|
+
info: please complete authentication in your browser...
|
68
|
+
To https://github.com/yukimeat1999/GNG-Unk-Env-Navi_RTC.git
|
69
|
+
! [rejected] main -> main (fetch first)
|
70
|
+
error: failed to push some refs to 'https://github.com/yukimeat1999/GNG-Unk-Env-Navi_RTC.git'
|
71
|
+
hint: Updates were rejected because the remote contains work that you do
|
72
|
+
hint: not have locally. This is usually caused by another repository pushing
|
73
|
+
hint: to the same ref. You may want to first integrate the remote changes
|
74
|
+
hint: (e.g., 'git pull ...') before pushing again.
|
75
|
+
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
|
76
|
+
```
|
77
|
+
と表示された.
|
78
|
+
|
79
|
+
つぎにこの[サイト](https://www.sejuku.net/blog/73151)を参考に,サブモジュール追加を試した.
|
80
|
+
|
81
|
+
しかし,
|
82
|
+
```GitHub
|
83
|
+
git push origin main
|
84
|
+
```
|
85
|
+
と入力すると,
|
86
|
+
```GitHub
|
87
|
+
error: failed to push some refs to 'https://github.com/yukimeat1999/GNG-Unk-Env-Navi_RTC.git'
|
88
|
+
hint: Updates were rejected because the tip of your current branch is behind
|
89
|
+
hint: its remote counterpart. Integrate the remote changes (e.g.
|
90
|
+
hint: 'git pull ...') before pushing again.
|
91
|
+
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
|
92
|
+
```
|
93
|
+
このようなエラーがでたため,この[サイト](https://dianxnao.com/git-push%E3%82%A8%E3%83%A9%E3%83%BC%EF%BC%9Aerror-failed-to-push-some-refs-to-%E3%81%AF%E3%83%AA%E3%83%A2%E3%83%BC%E3%83%88%E3%81%AE%E6%96%B9%E3%81%8C%E6%96%B0%E3%81%97%E3%81%84%E3%81%AE%E3%81%A7/)を参考に
|
94
|
+
|
95
|
+
```GitHub
|
96
|
+
git fetch
|
97
|
+
```
|
98
|
+
と入力すると,
|
99
|
+
```GitHub
|
100
|
+
remote: Enumerating objects: 414, done.
|
101
|
+
remote: Counting objects: 100% (167/167), done.
|
102
|
+
remote: Compressing objects: 100% (130/130), done.
|
103
|
+
remote: Total 414 (delta 45), reused 142 (delta 33), pack-reused 247
|
104
|
+
Receiving objects: 100% (414/414), 2.27 MiB | 3.13 MiB/s, done.
|
105
|
+
Resolving deltas: 100% (154/154), done.
|
106
|
+
From https://github.com/yukimeat1999/GNG-Unk-Env-Navi_RTC
|
107
|
+
* [new branch] main -> origin/main
|
108
|
+
```
|
109
|
+
となり,正常にできてそうなので,
|
110
|
+
```GitHub
|
111
|
+
git merge
|
112
|
+
```
|
113
|
+
と入力すると,
|
114
|
+
```GitHub
|
115
|
+
fatal: No remote for the current branch.
|
116
|
+
```
|
117
|
+
と表示され,pushもうまくいかなかった.
|
118
|
+
|
119
|
+
```GitHub
|
120
|
+
git push -u origin main
|
121
|
+
```
|
122
|
+
と試しに入れてもうまくいかなかった.
|
123
|
+
|
124
|
+
要約すると,```git add .```と```git merge```,``` git push origin main```で躓いてます.
|