zoukankan      html  css  js  c++  java
  • 上传项目到GitHub


    最近在写一个简单的androi项目,不过由于人员管理上松散,所以决定把代码提交至github,提前感受一下一直很火的github

    苦逼历程:

    1、本来想偷懒,看看有没有类似subversion,简单操作的团队开源工具,不过之前是在javaweb方向上使用,在移动开发上当然用适合的工具了,于是舍弃之

    2、再一想,有莫有eclipse的插件,集成上传,下载github上的源码呢?找到了http://www.iteye.com/topic/1122423使用github管理Eclipse分布式项目开发

    ,但是说的不是很详细,因为我的eclipse是最新google公司的版本,安上插件会报错,而且启动界面也会有变化,鼓捣了2个小时,但是仍然没有头绪,又舍弃之

    3、最后,我安定思痛,想想我想要的流程是什么?

    • 上传本地代码->github网站
    • 团队其他人从上面拷贝下来
    • 改完之后再提交上去
    于是google之,
    找到了2篇不错的文章:

    下面的代码是记录记录而已,有兴趣的可以看一下,时间比较仓促,还望多多够沟通,一起在github上关注、学习大牛们!得意



    Welcome to Git (version 1.8.3-preview20130601)
    
    
    Run 'git help git' to display the help index.
    Run 'git help <command>' to display help for specific commands.
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp
    $ git config --global user.name "jptiancai"
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp
    $ git config --global user.email mail_jzy@163.com
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp
    $ ssh-keygen -C 'mail_jzy@163.com' -t rsa
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp
    $ ssh-keygen -C 'mail_jzy@163.com' -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/c/Documents and Settings/Administrator/.ss
    h/id_rsa):
    /c/Documents and Settings/Administrator/.ssh/id_rsa already exists.
    Overwrite (y/n)? y
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /c/Documents and Settings/Administrator/.s
    sh/id_rsa.
    Your public key has been saved in /c/Documents and Settings/Administrator/.ssh/i
    d_rsa.pub.
    The key fingerprint is:
    9f:be:0c:2e:de:a5:5f:2b:86:3e:73:1d:33:71:60:ab mail_jzy@163.com
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp
    $ git init
    Initialized empty Git repository in D:/GitHub/RescueApp/.git/
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
    $ git add .
    warning: LF will be replaced by CRLF in AndroidManifest.xml.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in gen/com/yonvoo/main/BuildConfig.java.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in proguard-project.txt.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in project.properties.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in res/values-v11/styles.xml.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in res/values-v14/styles.xml.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in res/values/strings.xml.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in res/values/styles.xml.
    The file will have its original line endings in your working directory.
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
    $ git remote add origin git@github.com:jptiancai/RescueApp.git
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
    $ git push origin master
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
    $ git push origin master
    The authenticity of host 'github.com (204.232.175.90)' can't be established.
    RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
    Are you sure you want to continue connecting (yes/no)? y
    Please type 'yes' or 'no': yes
    Warning: Permanently added 'github.com,204.232.175.90' (RSA) to the list of know
    n hosts.
    error: src refspec master does not match any.
    error: failed to push some refs to 'git@github.com:jptiancai/RescueApp.git'
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
    $ git push origin master
    error: src refspec master does not match any.
    error: failed to push some refs to 'git@github.com:jptiancai/RescueApp.git'
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
    $ git commit -m 'initial commit'
    [master (root-commit) 926da3f] initial commit
    warning: LF will be replaced by CRLF in AndroidManifest.xml.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in gen/com/yonvoo/main/BuildConfig.java.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in proguard-project.txt.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in project.properties.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in res/values-v11/styles.xml.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in res/values-v14/styles.xml.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in res/values/strings.xml.
    The file will have its original line endings in your working directory.
    warning: LF will be replaced by CRLF in res/values/styles.xml.
    The file will have its original line endings in your working directory.
     74 files changed, 1548 insertions(+)
     create mode 100644 .gitattributes
     create mode 100644 .gitignore
     create mode 100644 AndroidManifest.xml
     create mode 100644 gen/com/yonvoo/main/BuildConfig.java
     create mode 100644 gen/com/yonvoo/main/R.java
     create mode 100644 ic_launcher-web.png
     create mode 100644 libs/android-support-v4.jar
     create mode 100644 proguard-project.txt
     create mode 100644 project.properties
     create mode 100644 res/drawable-hdpi/app_logo.png
     create mode 100644 res/drawable-hdpi/bg.png
     create mode 100644 res/drawable-hdpi/butten_pressed.png
     create mode 100644 res/drawable-hdpi/dark_dot.png
     create mode 100644 res/drawable-hdpi/guide_350_01.jpg
     create mode 100644 res/drawable-hdpi/guide_350_02.jpg
     create mode 100644 res/drawable-hdpi/guide_350_03.jpg
     create mode 100644 res/drawable-hdpi/guide_350_04.jpg
     create mode 100644 res/drawable-hdpi/ic_launcher.png
     create mode 100644 res/drawable-hdpi/item_bg.png
     create mode 100644 res/drawable-hdpi/photo8.png
     create mode 100644 res/drawable-hdpi/richangyiwai.png
     create mode 100644 res/drawable-hdpi/settings.png
     create mode 100644 res/drawable-hdpi/welcome.png
     create mode 100644 res/drawable-hdpi/welcome_android.jpg
     create mode 100644 res/drawable-hdpi/white_dot.png
     create mode 100644 res/drawable-hdpi/yundongzijiu.png
     create mode 100644 res/drawable-hdpi/ziranzaihai.png
     create mode 100644 res/drawable-ldpi/butten_pressed.png
     create mode 100644 res/drawable-ldpi/butten_unpress.png
     create mode 100644 res/drawable-ldpi/dark_dot.png
     create mode 100644 res/drawable-ldpi/guide_350_01.jpg
     create mode 100644 res/drawable-ldpi/guide_350_02.jpg
     create mode 100644 res/drawable-ldpi/guide_350_03.jpg
     create mode 100644 res/drawable-ldpi/guide_350_04.jpg
     create mode 100644 res/drawable-ldpi/ic_launcher.png
     create mode 100644 res/drawable-ldpi/logo.png
     create mode 100644 res/drawable-ldpi/welcome_android.jpg
     create mode 100644 res/drawable-ldpi/white_dot.png
     create mode 100644 res/drawable-mdpi/ic_launcher.png
     create mode 100644 res/drawable-xhdpi/ic_launcher.png
     create mode 100644 res/drawable/dot.xml
     create mode 100644 res/drawable/whats_new_start_btn.xml
     create mode 100644 res/layout/detail.xml
     create mode 100644 res/layout/griditem.xml
     create mode 100644 res/layout/guide.xml
     create mode 100644 res/layout/listview_item.xml
     create mode 100644 res/layout/main.xml
     create mode 100644 res/layout/splash.xml
     create mode 100644 res/layout/test.xml
     create mode 100644 res/layout/what_new_four.xml
     create mode 100644 res/layout/what_new_one.xml
     create mode 100644 res/layout/what_new_three.xml
     create mode 100644 res/layout/what_new_two.xml
     create mode 100644 res/menu/activity_main.xml
     create mode 100644 res/values-v11/styles.xml
     create mode 100644 res/values-v14/styles.xml
     create mode 100644 res/values/strings.xml
     create mode 100644 res/values/styles.xml
     create mode 100644 src/com/yonvoo/activity/DetailActivity.java
     create mode 100644 src/com/yonvoo/activity/GuideActivity.java
     create mode 100644 src/com/yonvoo/activity/MainActivity.java
     create mode 100644 src/com/yonvoo/activity/SecCategoryActivity.java
     create mode 100644 src/com/yonvoo/activity/SplashActivity.java
     create mode 100644 src/com/yonvoo/adapter/GridViewAdapter.java
     create mode 100644 src/com/yonvoo/adapter/ListViewAdapter.java
     create mode 100644 src/com/yonvoo/adapter/ViewPagerAdapter.java
     create mode 100644 src/com/yonvoo/domain/Category.java
     create mode 100644 src/com/yonvoo/domain/Detail.java
     create mode 100644 src/com/yonvoo/domain/SecCategory.java
     create mode 100644 src/com/yonvoo/service/CategoryService.java
     create mode 100644 src/com/yonvoo/service/DBHelper.java
     create mode 100644 src/com/yonvoo/service/DetailService.java
     create mode 100644 src/com/yonvoo/service/SecCategoryService.java
     create mode 100644 src/com/yonvoo/test/DBTest.java
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
    $ git push origin master
    To git@github.com:jptiancai/RescueApp.git
     ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'git@github.com:jptiancai/RescueApp.git'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first merge the remote changes (e.g.,
    hint: 'git pull') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
    $ git push -f
    warning: push.default is unset; its implicit value is changing in
    Git 2.0 from 'matching' to 'simple'. To squelch this message
    and maintain the current behavior after the default changes, use:
    
      git config --global push.default matching
    
    To squelch this message and adopt the new behavior now, use:
    
      git config --global push.default simple
    
    See 'git help config' and search for 'push.default' for further information.
    (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
    'current' instead of 'simple' if you sometimes use older versions of Git)
    
    Counting objects: 92, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (81/81), done.
    Writing objects: 100% (92/92), 2.20 MiB | 966.00 KiB/s, done.
    Total 92 (delta 12), reused 0 (delta 0)
    To git@github.com:jptiancai/RescueApp.git
     + be58463...926da3f master -> master (forced update)
    
    Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
    $
    


  • 相关阅读:
    2.2 范式和反范式
    1.7 关系数据库设计理论
    2.1 选择优化的数据类型
    1.6 间隙锁(next-key locking)
    1.5 MySQL的存储引擎
    1.4 多版本并发控制
    1.3 事物和并发一致性问题
    1.2 并发控制
    1.1 MySQL逻辑架构
    php自定义函数及内部函数----数组处理函数
  • 原文地址:https://www.cnblogs.com/jiangu66/p/3155519.html
Copyright © 2011-2022 走看看