在git開發(fā)中鞋屈,難免會因為分支過多難以管理昭抒。所以注釋是有必要的;
在安裝之前先要安裝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已經安裝完畢;
注意!O劭谩B冈獭:如果出現:說明你沒有切換到root用戶權限应闯;
最后執(zhí)行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
這樣可以解決沒有自動補全的問題;