๋ค๋ฅธ ์ฌ์ฉ์๊ฐ ์ฌ์ฉ์์ ๋์ผํ ๋ถ๊ธฐ์ ํธ์ํ ๊ฒฝ์ฐ Git์์ ๋ณ๊ฒฝ ๋ด์ฉ์ ํธ์ํ ์ ์์ต๋๋ค.
$ git push origin main
> To https://github.com/USERNAME/REPOSITORY.git
> ! [rejected] main -> main (non-fast-forward)
> error: failed to push some refs to 'https://github.com/USERNAME/REPOSITORY.git'
> To prevent you from losing history, non-fast-forward updates were rejected
> Merge the remote changes (e.g. 'git pull') before pushing again. See the
> 'Note about fast-forwards' section of 'git push --help' for details.
์๊ฒฉ ๋ถ๊ธฐ์ ๋ณ๊ฒฝ ๋ด์ฉ์ ๋ก์ปฌ๋ก ๋ณ๊ฒฝํ ๋ด์ฉ๊ณผ ํ์นํ๊ณ ๋ณํฉํ์ฌ ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ต๋๋ค.
$ git fetch origin
# Fetches updates made to an online repository
$ git merge origin YOUR_BRANCH_NAME
# Merges updates made online with your local work
๋๋ ๋ ๋ช
๋ น์ ํ ๋ฒ์ ๋ชจ๋ ์ํํ๋ ๋ฐ๋ง git pull
์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
$ git pull origin YOUR_BRANCH_NAME
# Grabs online updates and merges them with your local work