• 在GitHub上创建代码仓库


    目前在GitHub上管理托管带代码的人越来越多了,今天也尝试了一次,顺便记下来,备用。


    首先是在GitHub上创建一个代码仓库,创建完之后,GitHub上会有提示,这时进入项目目录执行下面的命令,顺便提一下,如果你的项目从未添加过,在执行git commit之前先执行 git add .  这样把代码就会加入追踪里面。

    Create a new repository on the command line

    touch README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https://github.com/lltppong-it/TeweWater.git
    git push -u origin master

    Push an existing repository from the command line

    git remote add origin https://github.com/lltppong-it/TeewWater.git
    git push -u origin master

    创建了仓库,如果不想要了的删除方法  

     Account Settings -->  Repositories -->  左边的 Settings —> 最下面 有一个 Delete this Repositories


    在GitHub上创建的仓库都是public的,除非你付费。在OSChina上可以创建private的仓库
    点击+可以创建新项目,然后按照上面说明,添加仓库. 其中是你创建项目的时候就会有的一个地址,直接换成OSChina的就可以
    https://github.com/lltppong-it/TeweWater.git
    在管理  --> 项目设置 里面可以删除项目
    如果创建的代码仓库里面添加了README.MD 和 LICENSE,文件建议先执行 git pull origin master,将这些文件pull下来,然后在 push

    Git 修改默认的编辑器
    git config --global core.editor vim
    global修改的是~/.gitconfig,将默认编辑器改为Vim, 且只对当前用户有效

  • 相关阅读:
    LeetCode 914. 卡牌分组
    LeetCode 999. 车的可用捕获量
    LeetCode 892. 三维形体的表面积
    21航电5E
    min25筛 学习笔记
    牛客多校6G
    2021航电多校3
    2021牛客多校H
    [模版] 快速傅里叶变换
    2021牛客多校第五场
  • 原文地址:https://www.cnblogs.com/wuyida/p/6300604.html
Copyright © 2020-2023  润新知