zoukankan      html  css  js  c++  java
  • Git 上传新项目

    1 在项目根目录下打开Git Bash 

    输入命令

    1.1//初始化仓库

    $ git init

    1.2// //添加文件到本地仓库

    git add .(可指定文件name,不指定默认文件夹下全部)

    1.3//添加文件描述信息

    git commit -m “first commit” 

    1.4//链接远程仓库,创建主分支

    git remote add origin + 远程仓库地址 

    1.5// 把本地仓库的变化连接到远程仓库主分支

    git pull origin master 

    1.6 //把本地仓库的文件推送到远程仓库

    git push -u origin master 

    在推送时若遇到错 请检查推送权限 或 仓库与本地仓是否同步

    hint: Updates were rejected because the tip of your current branch is behind
    hint: its remote counterpart. Integrate the remote changes (e.g.
    hint: 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.

    出现以上错误 可强制更新(仅适用新建项目首次推送)

    命令

    $ git push -u origin master -f
  • 相关阅读:
    [JSOI2010]解题报告+2010~2011小结
    有用的东西(emacs配置和bzoj数据下载网址)
    [JSOI2011]解题报告
    [JSOI2010]旅行题解
    [BOI2007]Mokia题解
    分块总结
    统计数字
    爬不出去的水井
    采药
    沙漠储油点
  • 原文地址:https://www.cnblogs.com/it66/p/14176319.html
Copyright © 2011-2022 走看看