zoukankan      html  css  js  c++  java
  • git传代码到github

    注册github账号

    https://github.com/

    安装git工具:

    https://git-for-windows.github.io/

    上面的准备工作完成后,现在开始操作。

    一、进入github首页,点击“New repository”按钮,新建一个仓库。

    二、填写相关信息,点击“Create repository”按钮,仓库创建成功,我们用到的是仓库名是newObject

    三、接下来,我们会进入下面的界面

    复制图中标记的链接“https://github.com/minigrasshopper/newObject.git”(每个人的都不一样哟)

    四、新建文件夹“testGit”用来存放代码。在“testGit”文件夹中,鼠标右键,选择“Git Bash Here”,进入下面的窗口

    五、将github仓库克隆到本地

    命令行执行 git clone https://github.com/minigrasshopper/newObject.git  (文件地址写你自己的)

    执行完成后,可在“testGit”文件夹中看到多出个“newObject”文件夹

    六、进入“newObject”文件夹

    命令行执行 cd newObject

    七、提交本地代码到github仓库

    复制一些项目到“newObject”文件夹

    然后执行下面操作即可

      

      第一个要配置的是你个人的用户名称和电子邮件地址。这两条配置很重要,每次 Git 提交时都会引用这两条信息,说明是谁提交了更新,所以会随更新内容一起被永久纳入历史记录:

      $ git config --global user.name "John Doe"
      $ git config --global user.email johndoe@example.com
    • git add                                  # 将github仓库的文件添加到本地
    • git commit -m "提交信息"     # 提交修改过的文件,并填写提交信息  exp:git commit -m "first commit"
    • git push -u origin master      # 把本地仓库push到github上面,此步骤需要你输入帐号和密码

    就这样,搞定啦,伙伴们,谢谢指导。

  • 相关阅读:
    poj 3666 Making the Grade
    poj 3186 Treats for the Cows (区间dp)
    hdu 1074 Doing Homework(状压)
    CodeForces 489C Given Length and Sum of Digits...
    CodeForces 163A Substring and Subsequence
    CodeForces 366C Dima and Salad
    CodeForces 180C Letter
    CodeForces
    hdu 2859 Phalanx
    socket接收大数据流
  • 原文地址:https://www.cnblogs.com/yaomin/p/7810233.html
Copyright © 2011-2022 走看看