[github]使用——上传工程到新建的repo
? ? 使用工具是eclipse的egit。
? ? 1、為工程創(chuàng)建本地git庫。工程右鍵->Team->Share Project...->Git
????
? ? 然后在Repository處選擇Create...。并輸入新Git Repository的名字,比如下圖中的Util:
????
? ? 點(diǎn)擊Finish即可。
? ? 然后將最新代碼提交,用commit。
????2、在github網(wǎng)站上創(chuàng)建一個(gè)新repo。
? ? 3、找到本地git的配置文件,以我的配置文件為例:C:\WINDOWS\system32\config\systemprofile\git\SlidingMenu\.git\config
? ? 打開這個(gè)配置文件,文件內(nèi)容如下:
[core]repositoryformatversion = 0filemode = falselogallrefupdates = trueautocrlf = false ? ? 我們需要加入遠(yuǎn)程和本地分支的信息,改后的文件如下: [core]repositoryformatversion = 0filemode = falselogallrefupdates = trueautocrlf = false [remote "origin"]url = https://github.com/tingzi/AndroidExample.gitfetch = +refs/heads/*:refs/remotes/origin/* [branch "master"]remote = originmerge = refs/heads/master? ? 4、對于第一次配置git,會(huì)需要填寫賬戶和密碼。
????
????5、將遠(yuǎn)程的代碼pull一下,雖然遠(yuǎn)程還沒有什么代碼,但是也需要先執(zhí)行一下,因此需要將遠(yuǎn)端的Init commit拉下來才行。
? ? 6、執(zhí)行push,將代碼提交到github。
? ? 以上只是我找到的一種方法,如果有更好的方法,還請?zhí)狳c(diǎn)啊。
轉(zhuǎn)載于:https://my.oschina.net/tingzi/blog/79303
總結(jié)
以上是生活随笔為你收集整理的[github]使用——上传工程到新建的repo的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Netbackup 添加策略_报NFS.
- 下一篇: 游戏开发随想之2D游戏架构