GitHub

来自牛奶河Wiki
阿奔讨论 | 贡献2023年11月16日 (四) 16:49的版本 →‎Error
跳到导航 跳到搜索

GitHub Person

价格计划(免费版)

  • Free
    • The basics for individuals and organizations
  • Unlimited public/private repositories
    • Host open source projects in public GitHub repositories, accessible via web or command line. Public repositories are accessible to anyone at GitHub.com.
  • 2,000 automation minutes/month
    • Free for public repositories
    • Use execution minutes with GitHub Actions to automate your software development workflows. Write tasks and combine them to build, test, and deploy any code project on GitHub.
  • 500MB of Packages storage
    • Free for public repositories
    • Host your own software packages or use them as dependencies in other projects. Both private and public hosting available.
  • New Issues & Projects (beta)
    • Community support
    • 免费(个人)版支持无限个数的私有(或公有)仓库, 每月2000分钟的自动构建时长, 单仓库最大 500M.
    • 查看详情: https://github.com/pricing
    • CI/CD,全称:持续集成 (Continuous Integration) ,持续部署 (Continuous Deployment) ,是开发流程的自动化利器

Git

  • 当前机器中有 id_rsa
  • 远程 github 中已加载 id_rsa.public(settings -> Access -> SSH &GPG keys)

INIT

  • git init
    • 在当前目录下建立 .git 目录
    • clone 的目录在此目录下
git config --global user.name ldscfe
git config --global user.email [email protected]
git config --global color.ui true   # git status等命令自动着色
# git config --list
# 自动判断提交位置(clone多个库)
git config --global push.default matching

Repository

# clone远程仓库
git clone [email protected]:ldscfe/pangolin.git
git clone [email protected]:ldscfe/udefpy3.git
git clone [email protected]:ldscfe/udefcp.git

git clone [email protected]:ldscfe/python.git
git clone [email protected]:ldscfe/cpp.git
git clone [email protected]:ldscfe/uetl.git
git clone [email protected]:ldscfe/shell.git

git clone [email protected]:ldscfe/test_cpp.git
# 刷新
git pull

# 修改文件
git checkout README.md
...
git commit -am "comment"
git push
# 增加文件
git add $FN


# Creating remote repositories
git remote add ldscfe_cpp [email protected]:ldscfe/cpp.git
git remote add ldscfe_pangolin [email protected]:ldscfe/pangolin.git
git remote add ldscfe_udefpy3 [email protected]:ldscfe/udefpy3.git
#You can use the command git remote set-url to change a remote's URL.
git remote set-url <REMOTE_URL> 


# Git Err
## fatal: Not a git repository (or any of the parent directories): .git
git remote add 出现,未先 git init

## git pull
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
# 需要指定下推同步的项目
git config --global push.default matching

Error

  • RSA 证书无或错误
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
  • Automatic merge failed; fix conflicts and then commit the result.
# 丢弃本地分支内容
git reset --hard origin/master