Mercurial Quick Start
username ¼³Á¤Çϱ⠶MercurialÀº Ä¿¹ÔÇÒ¶§ »ç¿ëµÇ´Â »ç¿ëÀÚÀ̸§À¸·Î 'user@localhost'¸¦ ±âº»°ªÀ¸·Î »ç¿ëÇÕ´Ï´Ù. ÀÌ°ÍÀº ´ë°Ô Àǹ̾øÀ¸¹Ç·Î Á¦´ë·ÎµÈ À̸ÞÀÏÁÖ¼Ò·Î ¼³Á¤ÇÏ´Â °ÍÀÌ ÁÁ½À´Ï´Ù.
~/.hgrc (À©µµ¿¡¼´Â %USERPROFILE%\Mercurial.ini) ÆÄÀÏ¿¡ ¾Æ·¡¿Í °°ÀÌ Ãß°¡Çϼ¼¿ä:
[ui] username = Author Name <email@address> ÀÌ¹Ì Á¸ÀçÇÏ´Â Mercurial ÇÁ·ÎÁ§Æ®¿¡¼ ÀÛ¾÷Çϱ⠶¸¸¾à ºê¶ó¿ìÁ®·Î È®ÀÎÇÒ ¼ö ÀÖ´Â ÀúÀå¼ÒÀÇ URLÀÌ ÀÖ´Ù¸é (¿¹: http://selenic.com/hg), ¾Æ·¡¿Í °°ÀÌ º¹»çº»À» °¡Á®¿Ã ¼ö ÀÖ½À´Ï´Ù:
$ hg clone http://selenic.com/hg(±âº»°ªÀ¸·Î) hg¶ó´Â »õ µð·ºÅ丮°¡ »ý¼ºµÇ¸ç, Àüü ÇÁ·ÎÁ§Æ®ÀÇ ±â·Ï(history)¸¦ °¡Á®¿À°í, °¡Àå ÃÖ½ÅÀÇ changesetÀ¸·Î üũ ¾Æ¿ô ÇÕ´Ï´Ù. Mercurial ÇÁ·ÎÁ§Æ® ¼³Á¤Çϱ⠶hg ÀúÀå¼Ò¸¦ Çϳª ¸¸µé¾î¼ ½ÃÀÛÇØ º¼ ¼öµµ ÀÖ½À´Ï´Ù:
$ cd project/ $ hg init # .hg ¸¸µêMercurialÀº ´ç½ÅÀÇ -ÇÁ·ÎÁ§Æ®ÀÇ- ·çÆ® µð·ºÅ丮¿¡¼ globÆÐÅϵé°ú Á¤±ÔÇ¥Çö½Äµé·Î ¹«½ÃÇÒ ÆÄÀϵéÀ» ¸ð¾ÆµÐ .hgignoreÆÄÀÏÀ» ã½À´Ï´Ù. ¾Æ·¡¿¡ .hgignore ÆÄÀÏ ¿¹Á¦°¡ ÀÖ½À´Ï´Ù. syntax: glob *.orig *.rej *~ *.o tests/*.err syntax: regexp .*\#.*\#$´ç½ÅÀÇ .hgignore ÆÄÀÏÀ» ½ÃÇèÇØ º¸¼¼¿ä: $ hg status # ¹«½ÃÇÏÁö ¾Ê´Â ÆÄÀϵéÀ» ¸ðµÎ º¸¿©ÁÖ±âÀÌ ¸í·É¾î´Â ¹«½ÃÇÏÁö ¾Ê´Â ¸ðµç ÆÄÀÏ°ú ? Ç¥½Ã(¹öÁ¯°ü¸® ÇÏÁö ¾ÊÀ½)¸¦ ¸®½ºÆ®¾÷ ÇÒ °ÍÀÔ´Ï´Ù. ´ç½ÅÀÇ .hgignore ÆÄÀÏÀ», status¸í·É ½ÇÇà½Ã ´ç½ÅÀÌ ¹öÁ¯°ü¸®(track) Çϱ⸦ ¿øÇÏ´Â ÆÄÀϵ鸸 ¸®½ºÆ®¾÷ µÉ ¶§ ±îÁö ¼öÁ¤Çϼ¼¿ä. .hgignore ÆÄÀÏ ¶ÇÇÑ ¹öÁ¯°ü¸® ÇÏ¿©¾ß ÇÒ °ÍÀÔ´Ï´Ù! ÇÏÁö¸¸ ºôµå °úÁ¤¿¡¼ »ý¼ºµÈ ÆÄÀϵéÀº ¹öÁ¯°ü¸® Çϱ⸦ ¿øÇÏÁö ¾Ê°ÚÁÒ. ¸¸Á·½º·¯¿ì¸é, -? Ç¥½ÃµÇ´Â- ÆÄÀϵéÀÇ Ãß°¡¸¦ ¿¹¾àÇÏ°í Ä¿¹ÔÇϼ¼¿ä. $ hg add # ±× 'unknown'ÆÄÀϵéÀ» Ãß°¡Çϱâ $ hg commit # ¸ðµç ¼öÁ¤ »çÇ×À» Ä¿¹ÔÇÏ°í, üÀÎÁö·Î±×¸¦ ÆíÁý ºê·»Ä¡Çϱâ, ¸ÓÁöÇϱ⠶$ hg clone project project-work # »õ ºê·»Ä¡¸¦ »ý¼º $ cd project-work $ <make changes> $ hg commit $ cd ../project $ hg pull ../project-work # project-work·Î ºÎÅÍ º¯°æ »çÇ×À» ¶¯°Ü¿À±â $ hg merge # project-workÀÇ ÃֽŠ³»¿ë(tip)À» ¿ì¸®ÀÇ ÀÛ¾÷ µð·ºÅ丮·Î ¸ÓÁöÇϱâ $ hg commit # ¸ÓÁö °á°ú¸¦ Ä¿¹ÔÇϱ⠳×Æ®¿öÅ© Áö¿ø ¶# ±âº» Mercurial ÀúÀå¼Ò·ÎºÎÅÍ º¹Á¦(clone) foo$ hg clone http://selenic.com/hg/ foo$ cd hg # ÀÌ¹Ì Á¸ÀçÇÏ´Â ÀúÀå¼Ò¸¦ °»½Å(update) foo$ hg pull http://selenic.com/hg/ # ºê¶ó¿ìÁ® °¡´ÉÇÑ ÀÎÅÍÆäÀ̽º¿Í ÇÔ²² ´ç½ÅÀÇ ÀúÀå¼Ò¸¦ HTTP·Î ³»º¸³»±â foo$ hg serve -n "My repo" -p 80 # SSH¸¦ ÅëÇؼ ¿ø°Ý ÀúÀå¼Ò¿¡ º¯°æ ³»¿ëÀ» ¹Ð¾î³Ö±â(push) foo$ hg push ssh://user@example.com/hg/ |
There is no fear in love; but perfect love casteth out fear. |