专栏名称: JavaScript
面向JavaScript爱好人员提供:前端最新资讯、原创内容、JavaScript、HTML5、Ajax、jQuery、Node.js等一系列教程和经验分享。
目录
相关文章推荐
51好读  ›  专栏  ›  JavaScript

Git 实用指南

JavaScript  · 公众号  · Javascript  · 2019-04-20 09:19

正文

请到「今天看啥」查看全文


[< options >] [--] ...

git commit

  1. git commit [<options>] [--] ...

git remote

remote 指的是本地的 git 仓库关联的远程 git 仓库。

1、查看远程仓库信息

  1. git remote

2、看远程仓库详细信息

  1. git remote -v

3、删除远程仓库

  1. git remote remove

  1. # 移除名字为 origin 的远程仓库

  2. git remote remove origin

4、添加远程仓库

  1. git remote add [-t ] [-m ] [-f] [--tags | --no-tags] [--mirror=<fetch|push>]

  1. git remote origin git@github.com:x-cold/git-learning.git

git branch

1、列出本地存在的分支

  1. git branch

2、列出远程分支

  1. git branch -r

3、列出本地和远程分支

  1. git branch -a

4、创建本地分支

  1. git branch [branchName] (remoteBranch)

  1. # 基于远程仓库的 dev 分支,创建本地仓库的 feature/canvas 分支

  2. git branch feature/canvas dev

5、分支重命名

  1. git branch [<options>] (-m | -M) [<old-branch>] <new-branch>

  1. # 修改 feature/canvas 分支名为 feature/canvas2

  2. git branch -M feature/canvas feature/canvas2

6、删除本地分支

  1. git branch -d |







请到「今天看啥」查看全文