zoukankan      html  css  js  c++  java
  • 【转】PhpStorm 提交代码到远程GitHub仓库

     

    转载地址:http://my.oschina.net/lujianing/blog/180728

    1.下载github for window

    http://windows.github.com/

    2.设置相关绑定

    Settings  ——Version Control——Git——Path to Git executable——选择你的安装目录

    C:UsersAdministratorAppDataLocalGitHubPortableGit_0f65d050d0c352fd38a0b25d82ee942deb19ef87ingit.exe

    Test

    Settings  ——Version Control——GitHub 

    Host:github.com  Login:账号  Password:密码

    Test

    3.项目的本地git提交

    intellij内部集成了git版本控制 所以在本地可以直接进行使用

    3.1创建本地仓库

    3.2提交代码到本地git

    右键项目或者文件 Git——Add——Commit (先add 然后再提交)

    4.配置远程提交

    4.1 github上创建仓库

    4.2 Git Shell中配置远程仓库

    cd 项目目录
     
    git remote add origin https://github.com/lujianing/ueditor.git
     
    git push -u origin master
    中间如果有报错 请参考下边的解决方法

    1.fatal: remote origin already exists

    git remote rm origin

    2.error: Could not remove config section 'remote.origin'

    需要修改gitconfig文件的内容 找到github的安装路径,我是

    C:UsersAdministratorAppDataLocalGitHubPortableGit_6d98349f44ba975cf6c762a720f8259a267ea445etc
    找到一个名为gitconfig的文件,打开它把里面的[remote "origin"]那一行删掉

    重启gitshell  执行上述操作

    4.3 Intellij IDEA中进行push/pull

    右键项目 Git——Repository——Push 

    在开发过程中 我们可以使用本地的git进行版本管理  最后使用push进行远程提交

    4.4 多人协作开发

    在Github 项目的 settings——Collaborators 下可以添加项目成员

    被添加的用户 可以提交代码到当前项目中

    5.另一种简单方法

    在github上创建仓库后 复制仓库地址 比如 https://github.com/lujianing/demo.git

    在intelij中 VCS——Checkout from Version Contrl——Git中 粘贴仓库url地址

    会从github仓库中拷贝一份项目   然后就可以在本地直接进行git操作

    并且可以push到github仓库中 (会提示你输入github的仓库和密码)

  • 相关阅读:
    luogu1197 [JSOI2008]星球大战
    luogu2085 最小函数值
    Vijos 1144 小胖守皇宫 【树形DP】
    洛谷 P1941 飞扬的小鸟 【DP+众多特判】
    codevs 1516 平均分数 【数学推理+求逆序对】
    tyvj 1936 太空战队 【强连通分量】
    USACO 2.4 Overfencing 【种子染色法+递推】
    code[vs] 2488 绿豆蛙的归宿【反向拓扑+DP】
    USACO 2.3 Zero Sum 【搜索+字符串处理+模拟计算】
    USACO 2.3 Cow Pedigrees 【DP+前缀和优化】
  • 原文地址:https://www.cnblogs.com/whroid/p/3963892.html
Copyright © 2011-2022 走看看