basis command
git init // 实例化本地仓库
git add <file> // 添加文件
git status // 查看状态
git commit // 提交到本地的仓库
git push // 推送到远程的仓库
git pull // 从远程仓库拉取数据
git clone // 从远程仓库拷贝数据
how to commit project
touch 文件名 // 新建一个文件
git config -g user.name 'MissNanLan' // 配置用户名
git config -g user.password ' '; // 配置密码
git status // 查看状态,红色的代表需要提交
git add . // 添加全部的文件
git rm --cached index.html // 删除index.html
git add *.html // 删除某一类的文件
git rm --cached *.html // 删除某一类的文件
git commit // 进入写日志的页面
:wq // 保存并退出
how to use ignore files
touch .gitignore // 创建一个忽略的文件

how to create branch
git branch 分支名称 // 创建分支
git checkout 分支名称 // 切换分支
git checkout master // 切换到主分支
git remote add origin 远程仓库名称 // 与远程仓库关联
git push -u origin master // 提交到远程仓库
how to set up github as a server
创建一个特别的仓库,注意仓库的名字必须和前面的相同,后缀一定是github.io

将你买的域名解析到这个服务器地址

在这个特别的仓库下的setting下面找到这个
Custome domain

输入你自己的域名即可,没有配置进行域名解析之前也可以通过https://MissNanLan.github.io
访问

网友评论