zoukankan      html  css  js  c++  java
  • Git提交到github上

    1、本地创建一个目录redis

    [guosong@etch171 mars171 redis]# pwd
    /data1/guosong/code/redis
    [guosong@etch171 mars171 redis]# ll
    total 12
    drwxr-xr-x 2 guosong guosong 4096 Oct 24 01:09 list_20141023
    drwxr-xr-x 2 guosong guosong 4096 Oct 23 00:36 sds_20141021
    drwxr-xr-x 2 guosong guosong 4096 Oct 23 23:13 sds_20141022
    

    2、生成git初始化仓库

    git init

    产生.git目录

    [guosong@etch171 mars171 .git]# more config 
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    

      

    3、配置用户名和邮箱

    git config --global user.name "sguo421"
    git config --global user.email "sguo421@gmail.com"
    

    .git/config文件发生变化

    [guosong@etch171 mars171 redis]# more .git/config 
    [core]
            repositoryformatversion = 0
            filemode = true
            bare = false
            logallrefupdates = true
    [remote "github"]
            url = https://github.com/sguo421
            fetch = +refs/heads/*:refs/remotes/github/*
    

      

    4、github配置ssh-keys

    避免提交的时候输入用户名和密码

    5、创建一个repository

    否则提示出错

    ERROR: Repository not found.
    fatal: The remote end hung up unexpectedly
    

      

    6、提交代码

    git add list_20141023/
    git add sds_2014102*
    
    git commit -m "learning redis source code step by step"
    
    #使用ssh远程提交模式
    #git remote add origin git@github.com:youusername/test.git
    
    git remote add origin git@github.com:sguo421/redis.git 
    git push -u origin master

      

    [参考资料]

    https://github.com/peterluo/LearningPythonDiary/blob/master/1.How%20to%20use%20git.md

      

  • 相关阅读:
    http 请求包含哪几个部分(请求行、请求头、请求体)
    BUG处理流程说明
    如何正确分析定位BUG
    如何定位bug是前端还是后端以及用的工具
    测试阶段划分为哪几个阶段?
    java实现一个简单的图书管理系统
    sql增、删、改、查基础封装类
    Ubuntu18.04 install sougou pinyin
    tensorboard网页打不开问题
    c++11 实现numpy argmax argmin
  • 原文地址:https://www.cnblogs.com/gsblog/p/4047288.html
Copyright © 2011-2022 走看看