http://stackoverflow.com/questions/4658606/import-existing-source-code-to-github

If you've got local source code you want to add to a new remote new git repository without 'cloning' the remote first, do the following (I often do this - you create your remote empty repository in bitbucket/github, then push up your source)

    1. Create the remote repository, and get the URL such asgit@github.com:/youruser/somename.git orhttps://github.com/youruser/somename.git

      If your local GIT repo is already set up, skips steps 2 and 3


    2. Locally, at the root directory of your source, git init

    3. Locally, add and commit what you want in your initial repo (for everything, git add . git commit -m 'initial commit comment')


    4. to attach your remote repo with the name 'origin' (like cloning would do)
      git remote add origin [URL From Step 1]

    5. Execute git pull origin master to pull the remote branch so that they are in sync.
    6. to push up your master branch (change master to something else for a different branch):
      git push origin master

最新文章

  1. gulp使用小结(二)
  2. jsp+servlet+mysql 实现简单的银行登录转账功能
  3. Java中Comparable和Comparator实现对象比较
  4. htmlnav
  5. 测试bug级别定义
  6. TNT平台
  7. 阿里巴巴fastJson
  8. Unity 地形
  9. Bundle压缩JS和CSS
  10. python executemany的使用
  11. Java基础学习笔记十 Java基础语法之final、static、匿名对象、内部类
  12. Common-used commands in Docker
  13. WordCount作业修改
  14. 20135327--linux内核分析 实践二
  15. 【费用流】【网络流24题】【P4014】 分配问题
  16. 【漏洞预警】方程式又一波大规模 0day 攻击泄漏,微软这次要血崩
  17. SpringCloud——服务网关
  18. Java开发工程师(Web方向) - 01.Java Web开发入门 - 第1章.Web应用开发概述
  19. JS之DOM对象二
  20. numpy.argmax 用在求解混淆矩阵用

热门文章

  1. java并发编程笔记(十)——HashMap与ConcurrentHashMap
  2. 异常的处理try-catch
  3. Cocos2d-x之Map<K, V>
  4. python-javascript之dom
  5. mysql 查看数据库最大连接数
  6. sourcetree配置gitlab
  7. 关于she'll脚本中"echo -e"使用sh命令执会显示参数"-e"-的问题
  8. ArcGIS 面要素缝隙孔洞检查代码 C# GP
  9. python2和python3编码
  10. HTML 使用CSS 如何去掉文本聚焦框 HTML 使用CSS 如何去掉文本聚焦框 : outline 值设为none 修改input、textarea输入框placeholder样式