[git & github] error: failed to push some refs to.. git pull ๋กœ ํ•ด๊ฒฐ

2024. 12. 18. 12:03ยทGit&GitHub

๐Ÿคท‍โ™‚๏ธ vscode - ๊นƒํ—ˆ๋ธŒ ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ Error ๐Ÿ’ฅ

์ƒˆ๋กœ์šด ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ๋ฅผ ์œ„ํ•ด ํ‰์†Œ์™€ ๊ฐ™์ด push! ํ•˜์ง€๋งŒ.. ์—๋Ÿฌ ๋ฐœ์ƒ error ์™€์˜ ํ•œํŒ ์Šน๋ถ€ ์˜ค๋Š˜๋„ ํ•ด๊ฒฐํ•˜๋Ÿฌ ๊ฐ€๋ณด์ž..

 ! [rejected]        main -> main (fetch first)
error: failed to push some refs to 'https://github.com/sihyun22/CoffeeOrder-Web.git'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

๐Ÿ’ซ ์›์ธ

๊ฐ€์žฅ ์ตœ๊ทผ ๊นƒํ—ˆ๋ธŒ README.md ํŒŒ์ผ์„ ์ˆ˜์ • ํ–ˆ์—ˆ๋Š”๋ฐ Local - Remote ๊ฐ„์˜ ํŒŒ์ผ์ด ์„œ๋กœ ๋‹ค๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ํŒŒ์ผ ์†์ƒ ๋ฌธ์ œ๋กœ

push๋ฅผ ๊ฑฐ๋ถ€ ํ–ˆ๋˜ ๊ฒƒ์ด์—ˆ๋‹ค! ๋”ฐ.๋ผ.์„œ ๋™๊ธฐํ™”๋ฅผ ๋จผ์ € ํ•ด์ค˜์•ผํ•œ๋‹ค.

 

git / github ์˜ ์ž‘์—… ํ๋ฆ„


๐Ÿ’ก  ํ•ด๊ฒฐ

1. git pull (repository ๊ฐ€์ ธ์˜ค๊ธฐ)

 

๋ฉ”์„ธ์ง€๊ฐ€ ๋งŒ๋“ค์–ด์ง€๋ฉด ์ €์žฅํ•˜๊ณ  ๋‚˜์˜ค๋ฉด ๋œ๋‹ค. ( ๋ช…๋ น์–ด  :wq  )

PS C:\Users\MIT-303\Desktop\psh\projects\web\kioskcoffee> git pull
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 10 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (10/10), 3.54 KiB | 226.00 KiB/s, done.
From https://github.com/sihyun22/CoffeeOrder-Web
   dda5495..061f458  main       -> origin/main
hint: Waiting for your editor to close the file...
Merge made by the 'ort' strategy.
 README.md | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 README.md

 

2. ๋‹ค์‹œ push

PS C:\Users\MIT-303\Desktop\psh\projects\web\kioskcoffee> git push -u origin main
Enumerating objects: 41, done.
Counting objects: 100% (37/37), done.
Delta compression using up to 12 threads
Compressing objects: 100% (31/31), done.
Writing objects: 100% (31/31), 2.24 MiB | 1.89 MiB/s, done.
Total 31 (delta 5), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (5/5), completed with 4 local objects.
To https://github.com/sihyun22/CoffeeOrder-Web.git
   061f458..c927d94  main -> main
branch 'main' set up to track 'origin/main'.

 


 

์ฝ”๋”ฉ ๊ณต๋ถ€์˜ ๋งˆ์ง€๋ง‰์€ ๊นƒ ํ—ˆ๋ธŒ ๋ฒ„์ „ ๊ด€๋ฆฌ ! ๊ทผ๋ฐ ์—ฌ๊ธฐ์„œ ์—๋Ÿฌ๋ฅผ ์ฒ˜์Œ ๋งˆ์ฃผํ•˜๋‹ˆ ์—ฅ..? ์ด๊ฒŒ ๋ฌด์Šจ์ผ์ธ๊ฐ€

ํ•˜์ง€๋งŒ ์—๋Ÿฌ๋ฅผ ํ•ด๊ฒฐํ•˜๊ณ  ๊นƒ๊ณผ ๊นƒํ—ˆ๋ธŒ์˜ ์ž‘์—… ํ๋ฆ„์„ ๊ณต๋ถ€ํ•˜๋Š” ์ข‹์€ ๊ธฐํšŒ๊ฐ€ ๋œ ๊ฒƒ ๊ฐ™์•„์„œ ๋ฟŒ๋“ฏํ•˜๋‹ค ^^

 

๋‹ค์Œ์€ ์–ด๋–ค ์—๋Ÿฌ๊ฐ€ ๊ธฐ๋‹ค๋ฆฌ๊ณ  ์žˆ์„๊นŒ ์•„์ฃผ ๊ธฐ๋Œ€๊ฐ€ ๋œ๋‹ค๐Ÿคฃ๐Ÿคฃ

 

 

 

'Git&GitHub' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Git] ๋จธ์ง€ ์ „์— ๋‚ด ์ฝ”๋“œ ์ง€ํ‚ค๋Š” ๋ฒ•: Git remote backup ํ™œ์šฉํ•˜๊ธฐ  (1) 2025.06.30
'Git&GitHub' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
  • [Git] ๋จธ์ง€ ์ „์— ๋‚ด ์ฝ”๋“œ ์ง€ํ‚ค๋Š” ๋ฒ•: Git remote backup ํ™œ์šฉํ•˜๊ธฐ
๐ŸŒŸ Sean ๐ŸŒŸ
๐ŸŒŸ Sean ๐ŸŒŸ
  • ๐ŸŒŸ Sean ๐ŸŒŸ
    Road to Dev
    ๐ŸŒŸ Sean ๐ŸŒŸ
  • ์ „์ฒด
    ์˜ค๋Š˜
    ์–ด์ œ
    • ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (38)
      • Project (7)
      • Spring (3)
      • Java (7)
      • JSP&Servlet (3)
      • Framework (1)
      • DBMS (3)
        • OracleDB (3)
      • JavaScript (4)
      • HTML+CSS (7)
      • Git&GitHub (2)
      • WEB (1)
  • ๋ธ”๋กœ๊ทธ ๋ฉ”๋‰ด

    • ํ™ˆ
    • ํƒœ๊ทธ
    • ๋ฐฉ๋ช…๋ก
  • ๋งํฌ

  • ๊ณต์ง€์‚ฌํ•ญ

  • ์ธ๊ธฐ ๊ธ€

  • ํƒœ๊ทธ

    DB
    Database
    css
    frontend
    docker
    html
    jsp
    Spring
    spring boot
    ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ
    DBMS
    OracleDB
    ์„œ๋ฒ„๋ฐฐํฌ
    java
    JavaScript
    ์ž๋ฐ”
    ์Šคํ”„๋ง๋ถ€ํŠธ
    js
    servlet
    gradle
  • ์ตœ๊ทผ ๋Œ“๊ธ€

  • ์ตœ๊ทผ ๊ธ€

  • hELLOยท Designed By์ •์ƒ์šฐ.v4.10.1
๐ŸŒŸ Sean ๐ŸŒŸ
[git & github] error: failed to push some refs to.. git pull ๋กœ ํ•ด๊ฒฐ
์ƒ๋‹จ์œผ๋กœ

ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”