发布于 

项目初次提交至github过程

简单记录备用

创建本地

  • 初始化一个空的git仓库
  • 将所有文件添加到暂存区
  • 将暂存区的文件提交到本地仓库

创建远程

1
2
git config --global user.name "ymkiux"
git config --global user.email "3255284101@qq.com"
  • 配置链接ssh
  • 获取当前生成的ssh

关联仓库

  • 将本地仓库和远程仓库关联起来
  • 查看当前的远程仓库地址

本地=>远程

  • 推送到远程仓库
  • 刷新github网站上的仓库页面即可看到效果

相关问题

1.fatal: remote origin already exists

  • 移除再重新关联库即可

    2.git push错误failed to push some refs to
  • 本地远程异同

    3.could not open directory ‘lib/wrapper/****services/‘: Filename too long

2.fatal: sha1 file ‘‘ write error: Broken pipe

  • git config –global http.postBuffer 15728640000

3.ssh:connect to host github.com port 22: Connection timed out

  • .ssh文件里面新建一个config文件

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    Host github.com
    User git
    Hostname ssh.github.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa
    Port 443

    Host gitlab.com
    Hostname altssh.gitlab.com
    User git
    Port 443
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa

4.Failed to connect to github.com port 443 after 21082 ms: Timed out

1
git config --global http.proxy 127.0.0.1:port