Github Usage

Github入门与实践 && Github Help && Pro Git


Github: 提供 Git 仓库的托管服务; 吉祥物: octocat
Pull Request: tell others about changes you’ve pushed to a branch in a repository on GitHub
Issues: track ideas, enhancements, tasks, or bugs for work on GitHub
GFM: [GitHub Flavored Markdown Spec](GitHub Flavored Markdown Spec)
Repositories: is like a folder for your project. Your project’s repository contains all of your project’s files and stores each file’s revision history.
Watch: receive notifications for new pull requests and issues that are created
Stars: keep track of projects you find interesting and discover similar projects in your news feed
Forks: a copy of a repository that you manage; let you make changes to a project without affecting the original repository
Follow: follow people on GitHub to receive notifications about their activity and discover projects in their communities


Git: a free and open source distributed version control system
config file for Git: ~/.gitconfig
git config –global user.name “Firstname Lastname”
git config –global user.email “your_email@example.com
Mac/Linux LF换行(Github) && Windows CRLF换行
git config –global core.autocrlf false
git config –global core.safecrlf true


SSH protocol
SSH Keys: connect to GitHub without supplying your username or password at each visit
创建: ssh-keygen -t rsa -C “your_email@example.com
本地位置: /.ssh/id_rsa.pub
远程位置: Github SSH kyes; [
/.ssh/authorized_keys](https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server)
测试: ssh -T git@github.com


mkdir foldName && cd folderName
git init
.git目录: 存储着管理当前目录内容所需的仓库数据
git status
git add .
git add filename/foldername
git commit
git commit -m “infor
git commit –amend
git log
git log –graph
git diff


git branch
git branch branchName
git branch -d branchName
git checkout branchName
git checkout -
git checkout -b newBracnName


git merge –no-ff branchName
git reset –hard hashValues
git rebase


git remote
git remote -v
git remote add nameforRemoteRepo remoteRepoUrl
git remote update nameforRemoteRepo
git push nameforRemoteRepo remoteBranchName
git push -u nameforRemoteRepo remoteBranchName : -u 设置默认上游分支


git clone url : 克隆到本地的同时默认将origin设为远程仓库标识符
git checkout -b anotherBranch origin/anoherBranch
git pull nameforRemoteRepo remoteBranchName
git fetch origin master
git merge origin/master