github 新增仓库的后的提示

…or create a new repository on the command line

echo "# top" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/liangkeno/top.git
git push -u origin master
…or push an existing repository from the command line git remote add origin https://github.com/liangkeno/top.git
git push -u origin master
…or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.

  


1,找到安装git的安装目录,C:\Program Files (x86)\Git\bin,win7在计算机属性中添加路径

2,使用命令行添加,set PATH=%PATH%;C:\Program Files (x86)\Git\bin

git 简明教程:http://rogerdudler.github.io/git-guide/index.zh.html


安装git的记录

1,配置git的全局参数,包括用户名,邮箱地址,生产SSH公密钥

  1--,命令行设置用户名,邮箱

      

git config --global user.name "username"
git config --global user.email "username@email.com"

  2,push.default参数主要是设置在执行push命令是的策略,主要的选项有以下几个:

  • nothing : Do not push anything
  • matching : Push all matching branches (default)
  • tracking : Push the current branch to whatever it is tracking
  • current : Push the current branch

这里我们手动设置成默认值:

git config --global push.default matching

  3,生成SSH key,在开始菜单中找到git bash并运行

$ssh-keygen -t rsa -C "username@email.com"

  此时会提示你输入存储key的文件名(我输入github),并提示你输入密码与确认密码(我这里选择不输入),接着会生成连个文件名一个是公钥与私钥文件并存储在C:\Users\***文件夹下:github,github.pub

  

  config文件,防止链接出现错误,代码如下:

 Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port

  

  4,绑定本机git与github

    1--,打开github.pub公钥文件,拷贝里面公钥文本

    2--,登陆官网https://github.com/,创建账号,进入设置,在SSH and GPG keys设置公钥,

  5,打开git bash,输入ssh git@github.com测试是否连接上github

  显示如下信息即已经连接成功

$ ssh git@github.com
PTY allocation request failed on channel 0
Hi ****! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.

  

  5,到此,既可以使用本机上的git连接github上的repository了


  使用git Bash 添加文件从本地到github仓库

  1,第一次更新到仓库

    1--,初始化本地仓库,

git init

    2--,更新到版本库

$ git add *
//错误提示

warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory.

  解决方法:

$ git config --global core.autocrlf false

//更新所有文件
$ git add . //更某个文件
$ git add 文件名 //更某个目录
$ git add 目录名/

    此时只是把文件放置缓存区

    3--,添加注释

$ git commit -m "相关说明"

    4--,关联到远程仓库

$ git remote add origin git@github.com:yourname/yourgit.git

    5--,推送到远程仓库

$ git push -u origin master

  2,再次更新到仓库,使用 add>>commit>>push origin master 即可

 git add .

error:   filename too long

 git config --global core.longpaths true

   3,把远程更新到本地仓库

   下载远程到本地 :git fetch origin master

   合并远程到本地:git merge origin/master

    

git 添加到环境变量的更多相关文章

  1. 下载git2.2.1并将git添加到环境变量中

    ># wget https://github.com/git/git/archive/v2.2.1.tar.gz > # tar zxvf v2.2.1.tar.gz ># cd g ...

  2. vue-cli如何添加多种环境变量

    vue-cli如何添加多种环境变量 目前webpack(vue-cli) 打包有两种变量,development, productor, 如何添加一个 test的测试环境呢 vue-cli 3.0 v ...

  3. linux下查看和添加PATH环境变量

    linux下查看和添加PATH环境变量 $PATH:决定了shell将到哪些目录中寻找命令或程序,PATH的值是一系列目录,当您运行一个程序时,Linux在这些目录下进行搜寻编译链接. 编辑你的 PA ...

  4. Mac 可设置环境变量的位置、查看和添加PATH环境变量

    Mac 启动加载文件位置(可设置环境变量) ------------------------------------------------------- (1)首先要知道你使用的Mac OS X是什 ...

  5. ***LINUX添加PHP环境变量:CentOS下将php和mysql命令加入到环境变量中

    CentOS系统下如何将PHP和mysql命令加入到环境变量中,在Linux CentOS系统上 安装完php和MySQL后,为了使用方便,需要将php和mysql命令加到系统命令中,如果在没有添加到 ...

  6. Mac可设置环境变量的位置、查看和添加PATH环境变量

    Mac 启动加载文件位置(可设置环境变量) 首先要知道你使用的 Mac OS X 是什么样的 Shell,使用命令 echo $SHELL 如果输出的是:csh 或者是 tcsh,那么你用的就是 C ...

  7. linux下添加PATH环境变量

    添加PATH环境变量,第1种方法:[root@lx_web_s1 ~]# export PATH=/usr/local/webserver/mysql/bin:$PATH 再次查看: [root@lx ...

  8. Mac下添加java环境变量

    2015年4月22号更新: 发现一个坑:最近发现有同事按照本文方式配置jdk环境变量一直不成功,后来发现他是使用了“Oh-My-Zsh”,配置文件的路径不是/etc/profile或~/.bash_p ...

  9. Linux 添加到环境变量

    在Linux下使用源码安装软件的时候,通常只能在软件安装目录下使用该软件命令,这样太麻烦,我们希望全局使用,可以将软件安装路径添加到系统环境变量里. 添加环境变量有2种方法: 1. 使用export命 ...

随机推荐

  1. WinForm c# 备份 还原 数据库(Yc那些事儿 转)

    Yc那些事儿 我愿意 为了我的幸福 奋斗终生     2008-11-17 18:04 WinForm c# 备份 还原 数据库 其实是个非常简单的问题,一个Form,一个Button,一个OpenF ...

  2. Java执行定时任务

    一.用java.util.Timer 使用JAVA类Timer可实现简单的延迟和周期性任务,其中的任务使用java.util.TimerTask表示.任务的执行方式有两种: 按固定速率执行:即sche ...

  3. 如何对HTMLTestRunner 进行输出print 进行修改

    在 HTMLTestRunner 模块中,在运行代码后,在输入的html页面值出现了特别简单的一个页面,那么现在如何将HTML页面中输出的更多print 在 HTMLTestRunner.py文件中查 ...

  4. Too Many open files 问题排查

    问题描述:使用netty做性能测试时,并发过大造成Too Many open files问题 该类错误是因为linux系统对socket连接时需要打开的文件句柄数有限制可以通过ulimit -a 查看 ...

  5. MYSQL 数据库命令行终端操作笔记

    1.数据库登录: 1.登录本地的MYSQL数据库:mysql -u root -p   2.连接远程主机上的MYSQL数据库:mysql -h 192.168.191.2 -u root -p 123 ...

  6. 使用jquery通过AJAX请求方式,后台返回了当前整个HTML页面代码

    该结果分为多种情况: 1.当前项目使用了interceptor/filter,拦截或者过滤了特定请求. 2.在HTML页面使用了表单提交,没有对表单的“onsubmit”事件做return false ...

  7. (转)Vue 爬坑之路(二)—— 组件之间的数据传递

    Vue 的组件作用域都是孤立的,不允许在子组件的模板内直接引用父组件的数据.必须使用特定的方法才能实现组件之间的数据传递. 首先用 vue-cli 创建一个项目,其中 App.vue 是父组件,com ...

  8. 使用cookies查询商品详情

    易买网项目完工,把一些新知识记录下来,以便以后查阅,也方便他人借阅.介绍使用cookies查询商品详情. 第一步:建立商品实体类. 第二步:连接Oracle数据库. 第三步:使用三层架构. 效果图如下 ...

  9. springboot测试类

    Controller测试类 /** * Created by zhiqi.shao on 2017/5/12. */ @RunWith(SpringJUnit4ClassRunner.class) @ ...

  10. 构造函数+原型的js混合模式

    function Parent(){ this.name = "李小龙"; this.age = "30"; };Parent.prototype.lev=fu ...