Git

Git] Migration

์™•๊ฐ€๐Ÿ‘ 2023. 7. 7. 17:29
728x90
๋ฐ˜์‘ํ˜•

Git์€ ํ•  ๋•Œ๋งˆ๋‹ค ํ•ญ์ƒ ์ƒˆ๋กญ๊ธด ํ•œ๋ฐ, ์ด๋ฒˆ์— ์ฒ˜์Œ์œผ๋กœ Migration์„ ํ•ด๋ดค์Šต๋‹ˆ๋‹ค.

๊ฐœ์ธ GitHub → GitLab์œผ๋กœ Migration ํ•˜๊ฒŒ ๋๋Š”๋ฐ,

์ž‘์—…์ง„ํ–‰ ํ–ˆ๋˜ ์ˆœ์„œ๋ฅผ ์„ค๋ช…ํ•˜๊ณ ์ž ํ•ฉ๋‹ˆ๋‹ค.

 

 


 

 

์ž‘์—… ์ˆœ์„œ

Repositroy ์ฃผ์†Œ๋ฅผ ์•„๋ž˜๋กœ ๊ฐ€์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

https://github.com/example/oldRepository.git

 

1. ์ƒˆ๋กœ์šด Repository ๋˜๋Š” Giblab Project๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

2. git bash์ฐฝ์„ ํ‚ค๊ณ ,  bare ์˜ต์…˜์œผ๋กœ clone์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

$ git clone --bare https://github.com/example/oldRepository.git

 

3. 2๋ฒˆ์—์„œ bare์˜ต์…˜์œผ๋กœ clone์ƒ์„ฑํ•œ ํด๋”๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

$ cd oldRepository.git

 

4. ์ƒˆ๋กœ์šด Repository์— mirror ์˜ต์…˜์„ ์ค˜์„œ push ํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

$ git push --mirror https://github.com/example/newRepository.git

 

์ด๋ ‡๊ฒŒ ํ•˜๋ฉด, ๊ธฐ์กด์˜ commit ๋‚ด์—ญ๊นŒ์ง€ ์ „๋ถ€ migration์ด ๋ฉ๋‹ˆ๋‹ค.

 

merge๋‚ด์—ญ๋„ ๋  ๊ฒƒ ๊ฐ™์€๋ฐ, ์ €๋Š” github → gitlab์œผ๋กœ ํ•œ๊ฑฐ๋ผ ์•ˆ๋œ ๊ฑฐ์ผ ์ˆ˜๋„ ์žˆ์„ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

 

728x90

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

Git] Revert & Reset  (0) 2023.07.11
Git] SSH(Secure Shell) Key  (0) 2023.07.09