Git常用命令
git add hello.txt 添加到存储区(hello.txt为文本文件)
git commit -m “由master提交” (-m是注解的意思。提交到远程仓库)
git push -u origin master(第一次push需要带-u参数)
git push origin a (提交到branch a,本地推到远程[Github]仓库)
git pull origin master (or another branch name )(将代码从远程仓库拉取下来)
git merge(合并,branch要在master的情况下进行git merge命令)
git chechkout a(branch name) (branch切换)
git branch -d a(branch name) (删除branch a)
git config --global(设置,例如设置user.name or user.email)
git clone git@github.com:XXXXX.git(github的地址)克隆(从Github克隆到本地)
ssh-keygen -t rsa(生成ssh秘钥,配置公共秘钥id_rsa.pub)
ssh git@github.com(检测ssh秘钥是否配置成功)
GitHub一些功能解释
pull request(请求合并,当frok了别人的代码的时候才能启动此功能)
gist(代码片段)
Issue (给作者写something 例如 此代码的bug 或者一些建议)
watch(观察,当你star了别人的代码时,开启watch功能,会提醒你代码更新情况)
frok(复制别人的代码到自己的GitHub)
star (收藏代码)