美文网首页
git常用命令和踩过的坑

git常用命令和踩过的坑

作者: Sissilovely | 来源:发表于2019-11-23 12:10 被阅读0次

    踩过的坑

    -1.每次都要重新输入账号密码
    '''git config --global credential.helper store'''
    -2.git 报错
    fatal: unable to access ‘https://github.com/xiaobingchan/machine_learn/‘: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
    运行命令:
    '''env GIT_SSL_NO_VERIFY=true'''

    常用命令

    1.增加:
    git add .
    git add *
    2.提交
    git commit -m '修改代码'
    3.上传
    git push
    git push -u origin master
    git push -f origin master #强制推送
    4.查看上传日志
    git log

    5.建立密钥
    方法:
    cd ~/.ssh && ssh-keygen
    其次,把公共密钥放置到github上,可以通过剪贴板来做这事g
    On OSX run: cat id_rsa.pub | pbcopy
    On Linux run: cat id_rsa.pub | xclip
    最后,设置你的git
    git config --global user.name "bob"
    git config --global user.email bob@...
    生成密钥

    或者直接:
    ssh-keygen -t rsa -C "hz@163.com"

    相关文章

      网友评论

          本文标题:git常用命令和踩过的坑

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