美文网首页
2019-03-24 git简单流程

2019-03-24 git简单流程

作者: 友少偏爱宅 | 来源:发表于2019-03-24 16:36 被阅读0次

    初始化

    git init

    设置邮箱用户名

    git config --global user.email "178282609@qq.com"

    git config --global user.name "neoiso"

    添加密钥

    ssh-keygen -t rsa -C '178282609@qq.com'

    注意保存的目录,比如

    Enter file in which to save the key (/root/.ssh/id_rsa):

    然后

    cat /root/.ssh/id_rsa.pub

    复制到网页添加密钥就行。

    克隆仓库

    git clone git@github.com:neoiso/neo.git

    暂时好了。先进去neo.

    实验下

    创建add.c

    添加

    git add add.c

    提交

    git commit -a -m"这是提交的信息"

    我的例子是新建的空仓库。

    最后上传

    git push

    可能出现警告信息

    Warning: Permanently added the RSA host key for IP address '13.250.177.223' to the list of known hosts.

    让我们把ip地址加入到.ssh下的know_hosts文件内就可以。或者无视它。

    原来按照网上教程 git remote add xxxxx

    的命令。结果老是出错。后来一想clone下载直接push得了。留作备用

    commit命令如果不加m参数会很烦,每次都要进去vim。手机操作实在繁琐。

    相关文章

      网友评论

          本文标题:2019-03-24 git简单流程

          本文链接:https://www.haomeiwen.com/subject/exbuvqtx.html