zoukankan      html  css  js  c++  java
  • 使用git在github上创建新工程

    这段时间进经常会忘记如何在github上同步工程,于是又得查资料,查参考书,浪费了很长时间,因此有了感触,写几篇有关此类问题的篇章!

    这是老手新手都十分容易犯的错误,就是在创建一个新github项目或者以本地已有项目为原型重新创建一个github项目时,容易创建一个空文件夹就直接关联远程仓库,这样做只会返回错误!!!所以,文件夹一定不能为空......

    创建新工程需要的命令

    完成本地项目与git的关联

    
    cd 工程目录
    git init    //初始化本地仓库,当前目录下会出现一个名为 .git 的目录
    git add .    //将所有文件添加到缓存区,告诉 Git 开始对这些文件进行跟踪
    git commit -am "Hello"    //提交文件到本地仓库
    
    

    完成远程项目的创建

    在github上创建某个项目,然后可以拷贝处该项目的地址

    关联远程仓库(github上创建的地址)

    
    git remote add origin https://github.com/Introspelliam/Hello.git    //关联远程仓库
    
    

    push本地项目到远程仓库

    
    git push origin master     //push项目到master
    Username for 'https://github.com': //你的github账户名称
    
    

    github上提供的工程创建方法

    …or create a new repository on the command line

    echo "# ctf-challenges" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git remote add origin https://github.com/Introspelliam/ctf-challenges.git
    git push -u origin master
    

    …or push an existing repository from the command line

    git remote add origin https://github.com/Introspelliam/ctf-challenges.git
    git push -u origin master
    

     参考文档:https://introspelliam.github.io/2017/06/30/tools/%E4%BD%BF%E7%94%A8git%E5%9C%A8github%E4%B8%8A%E5%88%9B%E5%BB%BA%E6%96%B0%E5%B7%A5%E7%A8%8B/

  • 相关阅读:
    Linux 升级make (gmake)
    C库函数-calloc()
    redis若干命令 中文翻译
    centos7 安装xinetd,telnet
    vim 显示行号
    重启redis
    TS 过滤 .meta文件
    TS 判断为空
    TS 聚合查询 读取MongoDB
    windows 编译libuv库.txt
  • 原文地址:https://www.cnblogs.com/dylancao/p/9692188.html
Copyright © 2011-2022 走看看