git------为分支添加注释

在git开发中,难免会因为分支过多难以管理。所以注释是有必要的;

在安装之前先要安装npm;

sudo apt install npm

可能会遇到问题:

Readingpackagelists... Done

Building dependency tree

Reading state information... Done

Somepackages couldnotbe installed. This may mean that you have

requested an impossible situationorifyouareusingthe unstable

distribution thatsomerequiredpackages havenotyet been created

orbeen movedoutofIncoming.

Thefollowinginformation mayhelptoresolve the situation:

Thefollowingpackages have unmet dependencies:

npm : Depends: nodejs but itisnotgoingtobe installed

Depends: node-abbrev (>=1.0.4) but itisnotgoingtobe installed

Depends: node-ansi (>=0.3.0-2) but itisnotgoingtobe installed

Depends: node-ansi-color-tablebut itisnotgoingtobe installed

Depends: node-archy but itisnotgoingtobe installed

Depends: node-block-stream but itisnotgoingtobe installed

Depends: node-fstream (>=0.1.22) but itisnotgoingtobe installed

Depends: node-fstream-ignorebut itisnotgoingtobe installed

Depends: node-github-url-from-git but itisnotgoingtobe installed

Depends: node-glob (>=3.1.21) but itisnotgoingtobe installed

Depends: node-graceful-fs (>=2.0.0) but itisnotgoingtobe installed

Depends: node-inherits but itisnotgoingtobe installed

Depends: node-ini (>=1.1.0) but itisnotgoingtobe installed

Depends: node-lockfile but itisnotgoingtobe installed

Depends: node-lru-cache(>=2.3.0) but itisnotgoingtobe installed

Depends: node-minimatch (>=0.2.11) but itisnotgoingtobe installed

Depends: node-mkdirp (>=0.3.3) but itisnotgoingtobe installed

Depends: node-gyp (>=0.10.9) but itisnotgoingtobe installed

Depends: node-nopt (>=3.0.1) but itisnotgoingtobe installed

Depends: node-npmlog but itisnotgoingtobe installed

Depends: node-once but itisnotgoingtobe installed

Depends: node-osenv but itisnotgoingtobe installed

Depends: node-readbut itisnotgoingtobe installed

Depends: node-read-package-json(>=1.1.0) but itisnotgoingtobe installed

Depends: node-request (>=2.25.0) but itisnotgoingtobe installed

Depends: node-retry but itisnotgoingtobe installed

Depends: node-rimraf (>=2.2.2) but itisnotgoingtobe installed

Depends: node-semver (>=2.1.0) but itisnotgoingtobe installed

Depends: node-shabut itisnotgoingtobe installed

Depends: node-slide but itisnotgoingtobe installed

Depends: node-tar (>=0.1.18) but itisnotgoingtobe installed

Depends: node-underscore but itisnotgoingtobe installed

Depends: node-which but itisnotgoingtobe installed

解决:

sudo apt-get install aptitude

sudo aptitude install npm

出现:Accept this solution? [Y/n/q/?]   请选择Y

The following NEW packages will be installed:

gyp{a}javascript-common{a}libjs-async{a}libjs-inherits{a}libjs-jquery{a}libjs-node-uuid{a}

libjs-underscore{a}node-abbrev{a}node-ansi{a}node-ansi-color-table{a}node-archy{a}node-async{a}

node-balanced-match{a}node-block-stream{a}node-brace-expansion{a}node-builtin-modules{a}

node-combined-stream{a}node-concat-map{a}node-cookie-jar{a}node-delayed-stream{a}node-forever-agent{a}

node-form-data{a}node-fs.realpath{a}node-fstream{a}node-fstream-ignore{a}node-github-url-from-git{a}

node-glob{a}node-graceful-fs{a}node-gyp{a}node-hosted-git-info{a}node-inflight{a}node-inherits{a}

node-ini{a}node-is-builtin-module{a}node-isexe{a}node-json-stringify-safe{a}node-lockfile{a}

node-lru-cache{a}node-mime{a}node-minimatch{a}node-mkdirp{a}node-mute-stream{a}node-node-uuid{a}

node-nopt{a}node-normalize-package-data{a}node-npmlog{a}node-once{a}node-osenv{a}node-path-is-absolute{a}

node-pseudomap{a}node-qs{a}node-read{a}node-read-package-json{a}node-request{a}node-retry{a}node-rimraf{a}

node-semver{a}node-sha{a}node-slide{a}node-spdx-correct{a}node-spdx-expression-parse{a}

node-spdx-license-ids{a}node-tar{a}node-tunnel-agent{a}node-underscore{a}node-validate-npm-package-license{a}

node-which{a}node-wrappy{a}node-yallist{a}npm

0packages upgraded,70newly installed,0toremoveand335notupgraded.

Needtoget2536kBofarchives. After unpacking15.2MB will be used.

The following packages have unmet dependencies:

nodejs : Conflicts: npm but3.5.2-0ubuntu4istobe installed

The following actions will resolve these dependencies:

    Keep the following packages at their current version:

1)    npm [NotInstalled]

Accept this solution? [Y/n/q/?] Y

No packages will be installed, upgraded,orremoved.

0packages upgraded,0newly installed,0toremoveand335notupgraded.

Needtoget0Bofarchives. After unpacking0B will be used.

npm -v  查看版本,可以看到npm已经安装完毕;

注意!!!:如果出现:说明你没有切换到root用户权限;



最后执行npm i -g git-br

安装git分支注释成功;

正常可以这样添加注释:

git config branch.分支名.description '这里添加注释'

然后获取分支注释;

git config branch.分支名.description

现在添加注释不变,但是可以  git br 命令获取分支和注释;

友情提示:

在安装之后可能会出现没有tab自动补全了,这个问题没有细去研究,过一会自动好了;

不过可以这么做:

1.下载配置文件 git clone git://git.kernel.org/pub/scm/git/git.git

2.cp  git/contrib/completion/git-completion.bash  ~/.git-completion.bash

3.在.bashrc中添加  source ~/.git-completion.bash

4.source ~/.bashrc

这样可以解决没有自动补全的问题;

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,456评论 5 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,370评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,337评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,583评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,596评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,572评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,936评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,595评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,850评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,601评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,685评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,371评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,951评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,934评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,167评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,636评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,411评论 2 342

推荐阅读更多精彩内容