新增本地代码到远程库

http://blog.csdn.net/hanhailong726188/article/details/46738929

github配置教程

http://www.runoob.com/w3cnote/git-guide.html

使用Git命令三实现代码上传与同步

http://www.jianshu.com/p/ac8923bce53e

首次建立git

http://www.jianshu.com/p/60c0741fcacc

拉取远程的Repo到本地(如果已经在本地,可以略过) 

$ git clone xxxxxx
在本地仓库删除文件 $ git rm 我的文件
在本地仓库删除文件夹 

$ git rm -r 我的文件夹/
此处-r表示递归所有子目录,如果你要删除的,是空的文件夹,此处可以不用带上-r。
提交代码 建立本地git库
$ git init 加入git版本控制
$ git add .(file) 提交到本地库
$ git commit -m"我的修改" 首次推送与GitHub库建立连接
$ git remote add origin https:github.com/xxx/xxxx.git 推送到远程仓库(比如GitHub)
$ git push origin master 后续推送
$ git push 首次推送
$ git push origin +master
新建库完整步骤:
全局配置:
$ git config --global user.name author #将用户名设为author
$ git config --global user.email author@corpmail.com #将用户邮箱设为author@corpmail.com
项目可配置不同name,email(不要--global 为项目配置)
查看:
$ cat ~/.gitconfig | head -3
建立ssh公钥:
ssh-keygen -t rsa -C 407934595@qq.com
复制公钥:vim ~/.ssh/id_rsa.pub
到github中添加公钥 设置默认分支
git config -e $ git init
$ git add *
$ git commit -m "123"
$ git remote add origin git@github.com:fosonRong/myfirstdll.git
$ git push origin +master
update:
$ git pull
$ git pull git@github.com:fosonRong/myfirstdll.git
												

git 上传本地代码的更多相关文章

  1. git 上传本地代码到远程仓库

    未经允许,禁止转载! 查看哪些文件被修改过:git status 查看具体的修改内容:git diff 对新添加的文件进行添加:git add 文件名 提交修改标记:git commit -m &qu ...

  2. Git上传本地代码

    Git  add  .将本地文件上传至缓冲区 git   commit  -m  'project  init'  将代码上传至本地仓库 Git   push   将本地的代码传至线上(码云) git ...

  3. 通过git上传本地代码到github仓库

    最近呢,武汉天气燥热,在公司没啥事,就自己写了一下小demo. 作为一个菜鸟,只在github上扒过别人的代码,还没自己上传过,就试了一下,遇到了一些坑,记录一下. 前提是电脑上安装了git,没有安装 ...

  4. git上传本地代码到github

      1.(先进入项目文件夹)通过命令 git init 把这个目录变成git可以管理的仓库 git init 2.把文件添加到版本库中,使用命令 git add .添加到暂存区里面去,不要忘记后面的小 ...

  5. git 上传本地代码到github 服务器

    git init git add . (所有文件用 点表示) git commit -m "注释语句" git remote add origin https://github.c ...

  6. git上传本地代码到远程失败

    出现这种错误的原因是由于我不小心勾选了这个

  7. git配置SSH Key,上传本地代码至github

    git配置全局的name和email git config --global user.name "name" git config --global user.email &qu ...

  8. 【GIT】Github上传本地代码详解

    本教程结合Github服务端和客户端完成本地代码上传至Github,下面进行详细讲解: 1.创建Github账号,这一个步骤应该不用太多解释,直接上官网进行注册登录即可https://github.c ...

  9. 【bug】----- Git上传文件错误导致本地代码丢失

    1.问题描述:通过Git上传本地文件,在git commit操作后本地未上传的代码全部丢失... 2.解决: 第一步:在项目目录下打开Git Bash: 第二步:输入 git reflog 第三步:在 ...

随机推荐

  1. 故事版(storyBoard)-lllegal configuration connection cannot have a prototype objct as

    今天下午做项目的时候.居然出了一个太不是问题的问题了,这个错误太低级了. lllegal configuration connection 'flagImg' cannot have a protot ...

  2. mod_jk是Apache服务器的一个可插入模块

    mod_jk简称JK,是Apache服务器的一个可插入模块,用以为Apache或IIS服务器提供处理JSP/Servlet的能力. Apache作为一款强大的Web服务器,本身缺乏处理JSP/Serv ...

  3. html标签的target属性应用

    1. 定义和用法 target 属性规定在何处打开页面上的所有链接. <head> <base target="_blank" /> </head&g ...

  4. shell本地变量和环境变量的对比

  5. squid代理与缓存(上)

    squid代理与缓存(上) 1. Squid介绍 1.1 缓存服务器介绍 缓存服务器(英文意思cache server),即用来存储(介质为内存及硬盘)用户访问的网页,图片,文件等等信息的专用服务器. ...

  6. HTML基础 用div布局实现一个简单网页

    div布局如下 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <t ...

  7. bzoj4898 & loj2308 [Apio2017]商旅 最短路+01分数规划

    题目传送门 https://lydsy.com/JudgeOnline/problem.php?id=4898 https://loj.ac/problem/2308 题解 发现我们可以把整个环路分成 ...

  8. 设置Oracle PL/SQL时间显示格式NLS_TIMESTAMP_FORMAT

    Oracle中TIMESTAMP时间的显示格式   Oracle数据库的时间字段我们通常是使用timestamp 格式,在未做设置前, 查询出来的数据类似于“27-1月 -08 12.04.35.87 ...

  9. Git中的分支

    具体请参考:https://git-scm.com/book/zh/v1/Git-%E5%88%86%E6%94%AF-%E4%BD%95%E8%B0%93%E5%88%86%E6%94%AF Git ...

  10. window系统命令cmd有哪些?

    CMD命令:开始->运行->键入cmd或command(在命令行里可以看到系统版本.文件系统版本)chcp 修改默认字符集chcp 936默认中文chcp 650011. appwiz.c ...