GitHub推送指南

Git推送指南。

装完之后先不要急着运行git——Bash

先调整它的启动位置

Git Bash属性:

    目标:D:\Git\git-bash.exe -(什么tohome都删掉,只保留路径

    起始位置:D:\Data_with_git(你想把程序丢哪里就丢哪里

本地仓库的事情,去看廖雪峰(liaoxuefeng)

https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000

然后稍微捋一下逻辑:

    你这个本地的仓库要想传到云端,首先得双方互相信任,

    Github这么搞的,在GIt_Bash里建立一个ssh密钥,然后手动把密钥粘贴进GitHub信任密钥里,

    然后这时候你的本地数据就可以这么上传了。

Example:

        1、添加进本地仓库:

            copy 某个文档比如“EACF”进仓库所在目录。  

        $ git add IDL_SACF_V2.5

       #(没有提示就是好提示

    2、 建立密钥(远程仓库): 

      $ ssh-keygen -t rsa -C "[email protected]"

            由于这个Key也不是用于军事目的,所以也无需设置密码。

            如果一切顺利的话,可以在用户主目录里找到.ssh目录,里面有id_rsa和id_rsa.pub两个文件,这两个就是SSH Key的秘钥对,id_rsa是私钥,不能泄露出去, id_rsa.pub是公钥,可以放心地告诉任何人。

            登陆GitHub,打开“Account settings”,“SSH Keys”页面:

            然后,点“Add SSH Key”,填上任意Title,在Key文本框里粘贴id_rsa.pub文件的内容

            至此,你的Github已经把你的本地gitbash添加到白名单了。

        邮箱通知:

The following SSH key was added to your account:

learing_git
92:bb:89:4e:b7:05:36:89:55:57:8f:90:ee:31:74:b3

If you believe this key was added in error, you can remove the key and disable
access at the following location:

https://github.com/settings/keys

    

        3、推送文件

git remote add IDL_SACF_V2.5 [email protected]:David-Lzy/IDL.git
git push -u IDL_SACF_V2.5 master

             结果:

Warning: Permanently added the RSA host key for IP address  '52.74.223.119' to the list of known hosts.
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Delta compression using up to 12 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 3.90 KiB | 1.30 MiB/s, done.
Total 9 (delta 0), reused 0 (delta 0)
To github.com:David-Lzy/IDL.git
   0833ee0..098e250  master -> master
Branch 'master' set up to track remote branch 'master' from  'IDL_SACF_V2.5'.

        4、commit:

git commit -m "first IDL Program"

            结果:

[master 098e250] first IDL Program
6 files changed, 238 insertions(+)
create mode 100644 IDL_SACF_V2.5/.project
create mode 100644 IDL_SACF_V2.5/Autocorrelation_function.Pro
create mode 100644 IDL_SACF_V2.5/Bash.txt
create mode 100644 IDL_SACF_V2.5/IDL_Bash.Pro
create mode 100644 IDL_SACF_V2.5/IDL_Data_Building.Pro
create mode 100644 IDL_SACF_V2.5/IDL_Data_Getting.Pro

David_Li

我还没有学会写个人说明!

相关推荐

暂无评论