<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                如果曾經有人對 GitHub 只提供唯一的版本庫格式(Git)托管表示過懷疑的話,那么今天看到 GitHub 對其他版本控制工具提供的愈發完善的支持,爭議應該煙消云散了吧。 # 6.2.1\. 用SVN操作GitHub 2008年4月1日,GitHub宣布推出基于SVN的SVNHub網站,后證實這是一個愚人節玩笑[[1]](https://github.com/blog/31-back-to-subversion)。2010年愚人節,類似消息再起,可這一次不再是玩笑[[2]](https://github.com/blog/626-announcing-svn-support)。即對于GitHub上的每一個Git版本庫,現在都可以用SVN命令進行操作。更酷的是 SVN 版本庫使用的是和 Git 版本庫同樣的地址[[3]](https://github.com/blog/966-improved-subversion-client-support)。 例如用下面的 Git 命令訪問本書的 Git 版本庫,顯示版本庫包含的引用。其中分支master用于維護書稿,分支gh-pages保存書稿編譯后的 HTML 網頁用于在 GitHub 上顯示。 ~~~ $ git ls-remote --heads https://github.com/gotgit/gotgithub ce5d3dda9b9ce8ec90def1da10181a094bea152f refs/heads/gh-pages c4d370b1b0bafb103de14e104ca18b8c31d80add refs/heads/master ~~~ 如果使用 SVN 命令訪問相同的版本庫地址,Git 服務器變身為一個 SVN 服務器,將Git的引用對應為 SVN 風格的分支。如下: ~~~ $ svn ls https://github.com/gotgit/gotgithub branches/ trunk/ $ svn ls https://github.com/gotgit/gotgithub/branches gh-pages/ ~~~ SVN 支持部分檢出,下面命令將整個主線trunk(相當于 Git 版本庫的master分支)檢出。 ~~~ $ svn checkout https://github.com/gotgit/gotgithub/trunk gotgithub A gotgithub/Makefile A gotgithub/README.rst ... Checked out revision 30. ~~~ 還可以使用 SVN 命令創建分支,即相當于在 Git 版本庫中創建新的引用。測試發現GitHub 尚不支持 SVN 遠程拷貝創建分支,需要通過本地拷貝再提交的方式創建新分支。操作如下: 1. 為避免檢出版本庫所有分支過于耗時,在檢出時使用--depth=empty參數。 ~~~ $ svn checkout --depth=empty \ https://github.com/gotgit/gotgithub gotgithub-branches Checked out revision 30. ~~~ 2. 進入到檢出目錄中,更新出trunk和branches兩個頂級目錄。 ~~~ $ cd gotgithub-branches $ svn up --depth=empty trunk branches A trunk Updated to revision 30. A branches Updated to revision 30. ~~~ 3. 通過拷貝從主線trunk創建分支branches/svn-github。 ~~~ $ svn cp trunk branches/svn-github A branches/svn-github $ svn st A + branches/svn-github ~~~ 4. 提交完成分支創建。 ~~~ $ svn ci -m "create branch svn-github from trunk" Authentication realm: <https://github.com:443> GitHub Username: gotgithub Password for 'gotgithub': Adding branches/svn-github Committed revision 31. ~~~ 5. 用 Git 命令可以看到服務器上創建了一個新的同名引用,并且指向和master一致。 ~~~ $ git ls-remote --heads https://github.com/gotgit/gotgithub ce5d3dda9b9ce8ec90def1da10181a094bea152f refs/heads/gh-pages c4d370b1b0bafb103de14e104ca18b8c31d80add refs/heads/master c4d370b1b0bafb103de14e104ca18b8c31d80add refs/heads/svn-github ~~~ 下面嘗試一下用 SVN 命令在新創建的分支svn-github中提交。 1. 進入到之前檢出完整主線trunk的gotgithub目錄,并將工作區切換為分支branches/svn-github。 ~~~ $ cd ../gotgithub $ svn switch https://github.com/gotgit/gotgithub/branches/svn-github At revision 31. ~~~ 2. 修改文件,查看工作區狀態。 ~~~ $ svn st M 06-side-projects/040-svn.rst ~~~ 3. 用 SVN 提交。 ~~~ $ svn ci -m "GitHub svn client support improved. Refs: http://git.io/svn" Sending 06-side-projects/040-svn.rst Transmitting file data . Committed revision 32. ~~~ 4. 同樣查看 Git 版本庫的更新,會發現svn-github分支的指向已和master不同。 ~~~ $ git ls-remote --heads https://github.com/gotgit/gotgithub ce5d3dda9b9ce8ec90def1da10181a094bea152f refs/heads/gh-pages c4d370b1b0bafb103de14e104ca18b8c31d80add refs/heads/master 64b80cb5331e28fdfb896e2ab3085779bf6ca019 refs/heads/svn-github ~~~ # 6.2.2\. 用Hg操作GitHub Hg(又稱Mercurial)和 Git 一樣也是一個被廣泛使用的分布式版本庫控制工具。如果一個熟悉 Hg 的開發者參與托管在 GitHub 上的項目,大可不必為更換版本控制工具而苦惱,GitHub 上的一個名為 hg-git[[1]](https://github.com/schacon/hg-git)的開源項目可以幫上忙。 得益于 Hg 的強大的插件擴展機制,安裝 hg-git 并將其注冊為Hg 插件后可提供Hg操作 Git 版本庫的能力。安裝 hg-git 可以直接使用?**easy_install**?命令: ~~~ $ sudo easy_install hg-git ~~~ 還可以直接從GitHub上下載hg-git最新代碼進行安裝: ~~~ $ curl -L -k -o hg-git.zip https://github.com/schacon/hg-git/zipball/master $ unzip hg-git.zip $ cd schacon-hg-git-* $ sudo easy_install . ~~~ 插件 hg-git 依賴于 Dulwich 項目,如果在安裝過程遇到 Dulwich 無法編譯,可能是因為缺乏 C 編譯器,或者尚未安裝 python-dev 軟件包。Dulwich 是一個Python語言的 Git 實現,因此 hg-git 在運行過程中無需 Git 命令行。 和其他 Hg 插件類似,安裝完畢后需要修改Hg配置文件(如文件?~/.hgrc?)如下,以啟用 hg-git 插件以及另外一個必須的 Hg 內置插件 —— bookmarks 插件。 ~~~ [extensions] bookmarks = hggit = ~~~ 對 hg-git 安裝配置完畢,就可以使用 Hg 操作 Git 版本庫了。 * 克隆 Git 版本庫。 ~~~ $ hg clone git://github.com/ossxp-com/hello-world.git $ cd hello-world ~~~ * Git 版本庫的分支轉換為 Hg 版本庫中的 bookmarks。 新克隆的 Hg 版本庫默認會更新到最新提交(即 tip 版本),未必處于所需的分支上。用命令**hg bookmarks**顯示分支列表,命令**hg parents**顯示工作區對應的版本。 ~~~ $ hg bookmarks helper/master 10:2767ad9d7008 helper/v1.x 8:994c2f0adc0b master 1:dcd365e3175c $ hg parents 修改集: 12:928384ca1e87 標簽: jx/v1.0-i18n 標簽: tip 用戶: Jiang Xin <jiangxin@ossxp.com> 日期: Fri Dec 31 12:12:42 2010 +0800 摘要: Translate for Chinese. ~~~ * 切換到所需的工作分支(如master分支)。 用hg update -r命令切換分支。之后執行**hg bookmarks**命令會看到當前工作分支用星號標識出來。 ~~~ $ hg update -r master $ hg book helper/master 10:2767ad9d7008 helper/v1.x 8:994c2f0adc0b * master 1:dcd365e3175c ~~~ * Git 的里程碑也被記錄,并可被?**hg tags**?命令顯示。 ~~~ $ hg tags tip 12:928384ca1e87 jx/v1.0-i18n 12:928384ca1e87 jx/v2.3 10:2767ad9d7008 ... ~~~ * 使用**hg pull**命令和**hg push**命令可以實現和Git版本庫的同步。 * 有的命令如**hg outgoing**可在 1.7 版本的Hg中運行正常,但對于高版本庫的 Hg 存在兼容性問題。 實際上 hg-git 插件并非只針對 GitHub 的版本庫,而是可以支持任意 Git 版本庫包括本地 Git 版本庫。為了提供對 Git 版本庫的透明支持,對 Git 版本庫的 URL的寫法有特殊要求,即要能夠從協議名稱區分開 Git 版本庫和默認的 Hg 版本庫。 * Git協議: git://example.com[:port]/path/to/repo.git * SSH協議: git+ssh://[user@]example.com[:port]/path/to/repo.git * HTTP協議: git+http://[user@]example.com[:port]/path/to/repo.git * HTTPS協議: git+https://[user@]example.com[:port]/path/to/repo.git * 本地協議: /path/to/repo.git
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看