๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • Maker's VAP
Study/ERROR

[VS Code / GitHub] ! [rejected] failed to push some refs to 'https://github.com/___/___.git'

by E = mc² 2020. 8. 12.

๐Ÿš– Error Hint

 

Updates were rejected because the remote contains work that you do not have locally.
This is usually caused by another repository pushing to the same ref.
You may want to first integrate the remote changes (e.g., 'git pull ...') before pushing again.
See the 'Note about fast-forwards' in 'git push --help' for details.

 

๐ŸŽƒ ์˜ค๋ฅ˜ ์›์ธ

์—ฐ๋™๋œ git master์—์„œ ์ œ๋Œ€๋กœ commit์ด ์•ˆ ๋˜๋Š” ๊ฒฝ์šฐ์ธ๋ฐ ๊นƒํ—ˆ๋ธŒ์—์„œ ์ €์žฅ์†Œ๋ฅผ ์ƒ์„ฑํ•  ๋•Œ

README.md ์ƒ์„ฑ์„ commit ํ–ˆ์ง€๋งŒ ๋กœ์ปฌ ์ €์žฅ์†Œ์—์„œ๋Š” README.md ์ƒ์„ฑ commit ํ–ˆ๋‹ค๋Š” ๊ฒƒ์„

์ธ์‹ํ•˜์ง€ ๋ชปํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์˜ค๋ฅ˜๊ฐ€ ๋‚˜๋Š” ๊ฒƒ

 


 

Visual Studio Code terminal์— ์œ„์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ๋œฐ ๋•Œ (๋…ธ๋ž€ ๋ฐ•์Šค ์•ˆ์—๋Š” ๊นƒํ—ˆ๋ธŒ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ๋ช…)

์•„๋ž˜ ๋ช…๋ น๋ฌธ์œผ๋กœ ๊ฐ•์ œ push ์‹œํ‚จ๋‹ค.

์ด๋•Œ -f๋Š” force๋ฅผ ๋œปํ•œ๋‹ค.

 

git push -f origin master

 

 

๊ทธ๋‹ค์Œ ํ˜„์žฌ ํ”„๋กœ์ ํŠธ ์ €์žฅ์†Œ ๋ฐ url์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š” ๋ช…๋ น๋ฌธ์„ ์ž…๋ ฅํ•˜๋ฉด

origin fetch, push url์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

 

git remote -v

 

 

master ๊ณ„์ •์œผ๋กœ ์ปค๋ฐ‹์„ ํ•ด๋ณด์ž.

VS Code ์ขŒ์ธก ํ•˜๋‹จ์˜ ๊ตฌ๋ฆ„ ๋˜๋Š” ํšŒ์ „ํ•˜๋Š” ๋ชจ์–‘์˜ ์•„์ด์ฝ˜์„ ํด๋ฆญํ•˜๋ฉด

 

์ด๋Ÿฐ ์ฐฝ์ด ํŒ์—… ๋˜๋Š”๋ฐ OK๋ฅผ ํด๋ฆญํ•œ ํ›„ ๊นƒํ—ˆ๋ธŒ ์ €์žฅ์†Œ๋ฅผ ํ™•์ธํ•˜๋ฉด ์ œ๋Œ€๋กœ ์—…๋กœ๋“œ๋œ ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค.

๋ฐ˜์‘ํ˜•

'Study > ERROR' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[MySQL] MySQL Installer ํฌํŠธ๋ฒˆํ˜ธ ์„ค์ • ์‹œ ์˜ค๋ฅ˜ the specified port already in use  (0) 2020.07.24

๋Œ“๊ธ€