zoukankan      html  css  js  c++  java
  • git学习,git上建立自己的项目

    官方帮助文档:

      https://help.github.com/articles/create-a-repo

    登录github,点 New Repository.如下面图所示,

    新建一个文件,初始化本地库git init,如下:

    Step 1: Create the README file

    In the prompt, type the following code:

    mkdir ~/Hello-World
    # Creates a directory for your project called "Hello-World" in your user directory
    cd ~/Hello-World
    # Changes the current working directory to your newly created directory
    git init
    # Sets up the necessary Git files
    # Initialized empty Git repository in /Users/you/Hello-World/.git/ touch README
    # Creates a file called "README" in your Hello-World directory


    提交自己的文件到库中,用到git add ,git commit命令,如下:

    Step 2: Commit your README

    Now that you have your README set up, it's time to commit it. A commit is essentially a snapshot of all the files in your project at a particular point in time. In the prompt, type the following code:

    git add README
    # Stages your README file, adding it to the list of files to be committed
    git commit -m 'first commit'
    # Commits your files, adding the message "first commit"


    提交自己的代码到github上,

      1,先添加远端,git remote add xxxxx

      2.push

      

    Step 3: Push your commit

    So far everything you've done has been in your local repository, meaning you still haven't done anything on GitHub yet. To connect your local repository to your GitHub account, you will need to set a remote for your repository and push your commits to it:

    git remote add origin https://github.com/username/Hello-World.git

    # Creates a remote named "origin" pointing at your GitHub repository
    git push origin master

    # Sends your commits in the "master" branch to GitHub




  • 相关阅读:
    记MongoDB的安装
    Python格式化输出指定宽度及占位符
    LMDB数据库加速Pytorch文件读取速度
    IDEA设置输入后自动提示
    IDEA2020 最新激活
    java 编译执行cmd命令
    算法9:What is the sum of the digits of the number 21000
    JAVA8 LocalDateTime
    算法8:已知 a^2+b^2=c^2(a,b,c 为自然数,a<b<c),且a+b+c=1000,求abc的值?
    ROS学习笔记
  • 原文地址:https://www.cnblogs.com/atyou/p/2953639.html
Copyright © 2011-2022 走看看