1 Star 1 Fork 0

爱乐北极光 / gitxx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
$ git clone git@github.com:mxthin/video.git
$ git init
$ git add .
$ git commit -m "更新内容"
$ git push -u origin master
输入用户名和密码
上传成功
$ git remote add origin git@github.com:mxthin/video.git

第一章节:上传第一份代码

第一小节:git说明

略去,请自行Google,啥?要翻墙,那你百度吧 本文以github、win10环境作为演示

第二小节:注册账号

打开github.com注册并登陆

点击右上角,在弹出菜单中选“Settings”,然后在新的页面中点击“SSH and GPG keys”,这时候你会看到有一个标着key的文本框等你填充,啥?你的没有,没有你点右上角的 “New SSH key” 按钮就有了

然后……页面不要关闭,等待指令

第三小节:构建本地环境并获取key

下载git并安装:https://git-for-windows.github.io/

安装完毕后,打开Git Bash,输入 git,出现如下代码说明安装成功。

$ git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

接下来 ,输入命令 ssh ,显示如图怎么ssh存在

m@ofpt MINGW64 ~
$ ssh
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char]
           [-F configfile] [-I pkcs11] [-i identity_file]
           [-L address] [-l login_name] [-m mac_spec]
           [-O ctl_cmd] [-o option] [-p port]
           [-Q cipher | cipher-auth | mac | kex | key]
           [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] [user@]hostname [command]

那么来生成ssh key,输入命令 ssh-keygen -t rsa ,然后按三次回车即可,生成的key的位置在你输入命令之后会显示出来。比如我的就在c/Users/m/.ssh/目录下

m@ofpt MINGW64 ~
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/m/.ssh/id_rsa):

这时候我们打开该目录,找到 id_rsa.pub,这是公钥,打开后复制里面的内容,然后回到第二小节里面打开的页面,把公钥内容黏贴到文本框内,title可以不填写,然后点击 Add SSH key 按钮提交。

我们回到 Git Bash,输入ssh -T git@github.com 如果出现

m@ofpt MINGW64 ~
$ ssh -T git@github.com
Hi your-github-name! You've successfully authenticated, but GitHub does not provide shell access.

说明公钥添加成功,联通正常

空文件

简介

git简要且实用学习教程 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/aycode/gitxx.git
git@gitee.com:aycode/gitxx.git
aycode
gitxx
gitxx
master

搜索帮助