๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ปSTUDY/Git

[Git] remote์— ์ด๋ฏธ pushํ•œ ํŒŒ์ผ ์ง€์šฐ๊ธฐ

๋ฐ˜์‘ํ˜•

[Git] remote์— ์ด๋ฏธ pushํ•œ ํŒŒ์ผ ์ง€์šฐ๊ธฐ

์›๊ฒฉ์ €์žฅ์†Œ์— ์˜ฌ๋ฆฐ ํŒŒ์ผ์„ ์‚ญ์ œํ•œ๋‹ค.

 

  1. ํŒŒ์ผ์„ ์‚ญ์ œํ•˜๋Š” ๋ฐฉ๋ฒ•์—๋Š” ๋‘๊ฐ€์ง€๊ฐ€ ์žˆ๋‹ค.
// lcoal
$ git rm [File Name]

// remote
$ git rm --cashed [File Name]

remote์— ์˜ฌ๋ผ๊ฐ„ ํŒŒ์ผ์€ --cashed๋ฅผ ๋ถ™์—ฌ ์ค˜์•ผ ํ•œ๋‹ค.

 

// ํŠน์ • ํŒŒ์ผ ์‚ญ์ œ
$ git rm --cached include/header.html

// ํด๋” ํ•˜์œ„์˜ ๋ชจ๋“  ํŒŒ์ผ ์‚ญ์ œ
$ git rm --cashed -r .include

 

์‚ญ์ œ ํ›„ git status ๋กœ ํ™•์ธํ•˜๊ณ , ์ด ์ƒํƒœ๋ฅผ remote์— ์ ์šฉํ•ด์•ผ ํ•œ๋‹ค.

 

// commit ํ›„,
$ git commit -m "Fix untracked files"

// push ํ•œ๋‹ค.
$ git push origin master

 

commit๊ณผ push๋ฅผ ํ•ด์ฃผ๋ฉด remote์— ๋ฐ˜์˜๋˜์–ด ํŒŒ์ผ์ด ์‚ญ์ œ๋œ๋‹ค.

 

 

Reference

https://makemethink.tistory.com/163

๋ฐ˜์‘ํ˜•