码迷,mamicode.com
首页 > 其他好文 > 详细

GitHub 命令行操作(完善中)

时间:2019-09-29 09:20:36      阅读:101      评论:0      收藏:0      [点我收藏+]

标签:查看   tps   回滚   远程   href   git log   git reset   同步   查询   

GitHub 命令行

本地repo

  • 设置姓名和邮箱

    git config --global user.name "xxxx"

    git config --global user.email "xxxx@yyy.zzz"

  • 创建并初始化本地空仓库

    git init <repo_name>

  • 查看提交的状态

    git status

  • 暂存区中添加更改

    git add <file_name>

  • 记录一行提交信息

    git commit -m "commit info"

  • 提交记录

    git log

  • 忽略特定格式文件格式

    touch .gitignore && vim .gitigonre

    *.out *.py # in .gitignore

    原有创建的格式用 git rm --cached <file_name> 忽略 常用工程的ignore文件

  • 回滚操作

    git reset (--mixed --hard --soft ) HEAD~(可换) #自己查询参数

    git commit --amend 轻微修改,不进行新的提交

远程repo

  • 查看分支

    git branch

  • 创建分支

    git branch <branch_name

  • 切换到分支

    git checkout <branch_name>

  • 创建并且切换

    git checkout -b <branch_name>

  • 分支合并

  • 分支同步

  • 分支删除与重命名

  • tag 管理

GitHub 命令行操作(完善中)

标签:查看   tps   回滚   远程   href   git log   git reset   同步   查询   

原文地址:https://www.cnblogs.com/hanxinle/p/11605676.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!