menu Chancel's Blog
rss_feed lightbulb_outline

我的笔记

Python - 为www-data用户安装pip包

通常在服务器上部署Python的Web服务时要搭配Nginx等web服务器,Nginx的默认用户是www-data

服务器如果也部署了其他web应用,如PHP,可以看到PHP也是使用www-data用户(当然也可以自己更改)

在Python3中,我们使用pip安装包时,通常是安装在当前用户的Home目录下,如

  • /home/chancel/.local/bin/

www-data如果要安装pip包,也必须具有Home目录,所以我们给www-data设置一个目录

sudo mkdir /var/www/.local

sudo mkdir /var/www/.cache

sudo chown www-data.www-data /var/www/.local

sudo chown www-data.www-data /var/www/.cache

设置完成后,尝试使用www-data用户安装pip包

sudo -H -u www-data pip install PyYAML

Develop Base Python 2021-04-21 09:27:06 location_on

Linux - 利用Curl操作WebDAV文件服务器

在命令行模式下通常我们需要拷贝日志或SQL文件用于日志分析数据分析,这个时候通常的做法是使用SCP或基于SCP的扩展软件如Winscp等工具

也有不少第三方的SSH工具自带文件管理,通常足够满足我们对于服务器文件的管理,但也有特殊情况

如PVE或者堡垒机等在网页上操作服务器,这个时候我们无法使用常规手段获取到服务器的文件,在网页的命令行中分析文件是在是一件要命的事情

恰好手头有一个能用的WebDAV服务器(通常家庭NAS/服务器文件管理器Web服务都会带),那就可以利用CURL来上传/下载文件

获取服务器dav文件列表,理论上应该会返回文件列表,但我的WebDAV服务器仅返回“Not Found”

❯ curl --user "username:password" 'https://www.chancel.ltd/dav/'
Not Found

上传文件

❯ curl --user "username:password" -T '/root/codes/route_restart/demo.log' 'https://www.chancel.ltd/dav/demo.log'

读取文件

❯ curl --user "username:password" 'https://www.chancel.ltd/dav/demo.log'

删除文件

❯ curl -X DELETE --user "username:password" 'https://www.chancel.ltd/dav/demo.log'

Develop Base Linux 2021-04-20 03:35:41 location_on

Markdown - 代码块语言标注支持名称列表(Python3)

经常使用Markdown语法,但对于代码块开头的三个分号```后面注解的语言类型一直属于想到什么写什么

使用Markdown解析器之后发现这一部分是有明确规范的写法的,于是从Python的pygments lexers 中提取这一部分解析列表出来,应该覆盖了绝大部分的语言缩写了

编程语言 支持的缩写
ABAP abap
AMDGPU amdgpu
APL apl
ABNF abnf
ActionScript 3 as3, actionscript3
ActionScript as, actionscript
Ada ada, ada95, ada2005
ADL adl
Agda agda
Aheui aheui
Alloy alloy
AmbientTalk at, ambienttalk, ambienttalk/2
Ampl ampl
HTML + Angular2 html+ng2
Angular2 ng2
ANTLR With ActionScript Target antlr-as, antlr-actionscript
ANTLR With C# Target antlr-csharp, antlr-c#
ANTLR With CPP Target antlr-cpp
ANTLR With Java Target antlr-java
ANTLR antlr
ANTLR With ObjectiveC Target antlr-objc
ANTLR With Perl Target antlr-perl
ANTLR With Python Target antlr-python
ANTLR With Ruby Target antlr-ruby, antlr-rb
ApacheConf apacheconf, aconf, apache
AppleScript applescript
Arduino arduino
Arrow arrow
AspectJ aspectj
Asymptote asy, asymptote
Augeas augeas
AutoIt autoit
autohotkey ahk, autohotkey
Awk awk, gawk, mawk, nawk
BBC Basic bbcbasic
BBCode bbcode
BC bc
BST bst, bst-pybtex
BARE bare
Base Makefile basemake
Bash bash, sh, ksh, zsh, shell
Bash Session console, shell-session
Batchfile bat, batch, dosbatch, winbatch
Befunge befunge
BibTeX bib, bibtex
BlitzBasic blitzbasic, b3d, bplus
BlitzMax blitzmax, bmax
BNF bnf
Boa boa
Boo boo
Boogie boogie
Brainfuck brainfuck, bf
BUGS bugs, winbugs, openbugs
CAmkES camkes, idl4
C c
CMake cmake
c-objdump c-objdump
CPSA cpsa
aspx-cs aspx-cs
C# csharp, c#
ca65 assembler ca65
cADL cadl
CapDL capdl
Cap'n Proto capnp
CBM BASIC V2 cbmbas
CDDL cddl
Ceylon ceylon
CFEngine3 cfengine3, cf3
ChaiScript chai, chaiscript
Chapel chapel, chpl
Charmci charmci
HTML+Cheetah html+cheetah, html+spitfire, htmlcheetah
JavaScript+Cheetah js+cheetah, javascript+cheetah, js+spitfire, javascript+spitfire
Cheetah cheetah, spitfire
XML+Cheetah xml+cheetah, xml+spitfire
Cirru cirru
Clay clay
Clean clean
Clojure clojure, clj
ClojureScript clojurescript, cljs
COBOLFree cobolfree
COBOL cobol
CoffeeScript coffee-script, coffeescript, coffee
Coldfusion CFC cfc
Coldfusion HTML cfm
cfstatement cfs
Common Lisp common-lisp, cl, lisp
Component Pascal componentpascal, cp
Coq coq
C++ cpp, c++
cpp-objdump cpp-objdump, c++-objdumb, cxx-objdump
Crmsh crmsh, pcmk
Croc croc
Cryptol cryptol, cry
Crystal cr, crystal
Csound Document csound-document, csound-csd
Csound Orchestra csound, csound-orc
Csound Score csound-score, csound-sco
CSS+Django/Jinja css+django, css+jinja
CSS+Ruby css+erb, css+ruby
CSS+Genshi Text css+genshitext, css+genshi
CSS css
CSS+PHP css+php
CSS+Smarty css+smarty
CUDA cuda, cu
Cypher cypher
Cython cython, pyx, pyrex
D d
d-objdump d-objdump
Darcs Patch dpatch
Dart dart
DASM16 dasm16
Debian Control file control, debcontrol
Delphi delphi, pas, pascal, objectpascal
Devicetree devicetree, dts
dg dg
Diff diff, udiff
Django/Jinja django, jinja
Docker docker, dockerfile
DTD dtd
Duel duel, jbst, jsonml+bst
Dylan session dylan-console, dylan-repl
Dylan dylan
DylanLID dylan-lid, lid
ECL ecl
eC ec
Earl Grey earl-grey, earlgrey, eg
Easytrieve easytrieve
EBNF ebnf
Eiffel eiffel
Elixir iex session iex
Elixir elixir, ex, exs
Elm elm
EmacsLisp emacs, elisp, emacs-lisp
E-mail email, eml
ERB erb
Erlang erlang
Erlang erl session erl
HTML+Evoque html+evoque
Evoque evoque
XML+Evoque xml+evoque
execline execline
Ezhil ezhil
F# fsharp, f#
FStar fstar
Factor factor
Fancy fancy, fy
Fantom fan
Felix felix, flx
Fennel fennel, fnl
Fish fish, fishshell
Flatline flatline
FloScript floscript, flo
Forth forth
FortranFixed fortranfixed
Fortran fortran
FoxPro foxpro, vfp, clipper, xbase
Freefem freefem
Futhark futhark
GAP gap
GDScript gdscript, gd
GLSL glsl
GAS gas, asm
Genshi genshi, kid, xml+genshi, xml+kid
Genshi Text genshitext
Gettext Catalog pot, po
Gherkin cucumber, gherkin
Gnuplot gnuplot
Go go
Golo golo
GoodData-CL gooddata-cl
Gosu gosu
Gosu Template gst
Graphviz graphviz, dot
Groff groff, nroff, man
Groovy groovy
HLSL hlsl
Haml haml
HTML+Handlebars html+handlebars
Handlebars handlebars
Haskell haskell, hs
Haxe hx, haxe, hxsl
Hexdump hexdump
HSAIL hsail, hsa
Hspec hspec
HTML+Django/Jinja html+django, html+jinja, htmldjango
HTML+Genshi html+genshi, html+kid
HTML html
HTML+PHP html+php
HTML+Smarty html+smarty
HTTP http
Hxml haxeml, hxml
Hy hylang
Hybris hybris, hy
IDL idl
Icon icon
Idris idris, idr
Igor igor, igorpro
Inform 6 inform6, i6
Inform 6 template i6t
Inform 7 inform7, i7
INI ini, cfg, dosini
Io io
Ioke ioke, ik
IRC logs irc
Isabelle isabelle
J j
JAGS jags
Jasmin jasmin, jasminxt
Java java
JavaScript+Django/Jinja js+django, javascript+django, js+jinja, javascript+jinja
JavaScript+Ruby js+erb, javascript+erb, js+ruby, javascript+ruby
JavaScript+Genshi Text js+genshitext, js+genshi, javascript+genshitext, javascript+genshi
JavaScript js, javascript
JavaScript+PHP js+php, javascript+php
JavaScript+Smarty js+smarty, javascript+smarty
JCL jcl
JSGF jsgf
JSONBareObject
JSON-LD jsonld, json-ld
JSON json, json-object
Java Server Page jsp
Julia console jlcon
Julia julia, jl
Juttle juttle
Kal kal
Kconfig kconfig, menuconfig, linux-config, kernel-config
Kernel log kmsg, dmesg
Koka koka
Kotlin kotlin
LSL lsl
CSS+Lasso css+lasso
HTML+Lasso html+lasso
JavaScript+Lasso js+lasso, javascript+lasso
Lasso lasso, lassoscript
XML+Lasso xml+lasso
Lean lean
LessCss less
Lighttpd configuration file lighty, lighttpd
Limbo limbo
liquid liquid
Literate Agda lagda, literate-agda
Literate Cryptol lcry, literate-cryptol, lcryptol
Literate Haskell lhs, literate-haskell, lhaskell
Literate Idris lidr, literate-idris, lidris
LiveScript live-script, livescript
LLVM llvm
LLVM-MIR Body llvm-mir-body
LLVM-MIR llvm-mir
Logos logos
Logtalk logtalk
Lua lua
MIME mime
MOOCode moocode, moo
MSDOS Session doscon
Makefile make, makefile, mf, bsdmake
CSS+Mako css+mako
HTML+Mako html+mako
JavaScript+Mako js+mako, javascript+mako
Mako mako
XML+Mako xml+mako
MAQL maql
markdown md, markdown
Mask mask
Mason mason
Mathematica mathematica, mma, nb
Matlab matlab
Matlab session matlabsession
MiniD minid
MiniScript ms, miniscript
Modelica modelica
Modula-2 modula2, m2
MoinMoin/Trac Wiki markup trac-wiki, moin
Monkey monkey
Monte monte
MoonScript moon, moonscript
Mosel mosel
CSS+mozpreproc css+mozpreproc
mozhashpreproc mozhashpreproc
Javascript+mozpreproc javascript+mozpreproc
mozpercentpreproc mozpercentpreproc
XUL+mozpreproc xul+mozpreproc
MQL mql, mq4, mq5, mql4, mql5
Mscgen mscgen, msc
MuPAD mupad
MXML mxml
MySQL mysql
CSS+Myghty css+myghty
HTML+Myghty html+myghty
JavaScript+Myghty js+myghty, javascript+myghty
Myghty myghty
XML+Myghty xml+myghty
NCL ncl
NSIS nsis, nsi, nsh
NASM nasm
objdump-nasm objdump-nasm
Nemerle nemerle
nesC nesc
NewLisp newlisp
Newspeak newspeak
Nginx configuration file nginx
Nimrod nim, nimrod
Nit nit
Nix nixos, nix
Notmuch notmuch
NuSMV nusmv
NumPy numpy
objdump objdump
Objective-C objective-c, objectivec, obj-c, objc
Objective-C++ objective-c++, objectivec++, obj-c++, objc++
Objective-J objective-j, objectivej, obj-j, objj
OCaml ocaml
Octave octave
ODIN odin
Ooc ooc
Opa opa
OpenEdge ABL openedge, abl, progress
PacmanConf pacmanconf
Pan pan
ParaSail parasail
Pawn pawn
PEG peg
Perl6 perl6, pl6, raku
Perl perl, pl
PHP php, php3, php4, php5
Pig pig
Pike pike
PkgConfig pkgconfig
PL/pgSQL plpgsql
Pointless pointless
Pony pony
PostScript postscript, postscr
PostgreSQL console (psql) psql, postgresql-console, postgres-console
PostgreSQL SQL dialect postgresql, postgres
POVRay pov
PowerShell powershell, posh, ps1, psm1
PowerShell Session ps1con
Praat praat
Prolog prolog
PromQL promql
Properties properties, jproperties
Protocol Buffer protobuf, proto
PsySH console session for PHP psysh
Pug pug, jade
Puppet puppet
PyPy Log pypylog, pypy
Python 2.x python2, py2
Python 2.x Traceback py2tb
Python console session pycon
Python python, py, sage, python3, py3
Python Traceback pytb, py3tb
QBasic qbasic, basic
QVTO qvto, qvt
QML qml, qbs
RConsole rconsole, rout
Relax-NG Compact rnc, rng-compact
RPMSpec spec
Racket racket, rkt
Ragel in C Host ragel-c
Ragel in CPP Host ragel-cpp
Ragel in D Host ragel-d
Embedded Ragel ragel-em
Ragel in Java Host ragel-java
Ragel ragel
Ragel in Objective C Host ragel-objc
Ragel in Ruby Host ragel-ruby, ragel-rb
Raw token data
Rd rd
ReasonML reason, reasonml
REBOL rebol
Red red, red/system
Redcode redcode
reg registry
ResourceBundle resource, resourcebundle
Rexx rexx, arexx
RHTML rhtml, html+erb, html+ruby
Ride ride
Roboconf Graph roboconf-graph
Roboconf Instances roboconf-instances
RobotFramework robotframework
RQL rql
RSL rsl
reStructuredText rst, rest, restructuredtext
TrafficScript rts, trafficscript
Ruby irb session rbcon, irb
Ruby rb, ruby, duby
Rust rust, rs
SAS sas
S splus, s, r
Standard ML sml
SARL sarl
Sass sass
Scala scala
Scaml scaml
scdoc scdoc, scd
Scheme scheme, scm
Scilab scilab
SCSS scss
ShExC shexc, shex
Shen shen
Sieve sieve
Silver silver
Singularity singularity
Slash slash
Slim slim
Slurm slurm, sbatch
Smali smali
Smalltalk smalltalk, squeak, st
SmartGameFormat sgf
Smarty smarty
Snobol snobol
Snowball snowball
Solidity solidity
SourcePawn sp
Debian Sourcelist sourceslist, sources.list, debsources
SPARQL sparql
SQL sql
sqlite3con sqlite3
SquidConf squidconf, squid.conf, squid
Scalate Server Page ssp
Stan stan
Stata stata, do
SuperCollider sc, supercollider
Swift swift
SWIG swig
systemverilog systemverilog, sv
TAP tap
Typographic Number Theory tnt
TOML toml
TADS 3 tads3
TASM tasm
Tcl tcl
Tcsh tcsh, csh
Tcsh Session tcshcon
Tea tea
Tera Term macro ttl, teraterm, teratermmacro
Termcap termcap
Terminfo terminfo
Terraform terraform, tf
TeX tex, latex
Text only text
Thrift thrift
tiddler tid
Todotxt todotxt
Transact-SQL tsql, t-sql
Treetop treetop
Turtle turtle
HTML+Twig html+twig
Twig twig
TypeScript ts, typescript
TypoScriptCssData typoscriptcssdata
TypoScriptHtmlData typoscripthtmldata
TypoScript typoscript
ucode ucode
Unicon unicon
UrbiScript urbiscript
USD usd, usda
VBScript vbscript
VCL vcl
VCLSnippets vclsnippets, vclsnippet
VCTreeStatus vctreestatus
VGL vgl
Vala vala, vapi
aspx-vb aspx-vb
VB.net vb.net, vbnet
HTML+Velocity html+velocity
Velocity velocity
XML+Velocity xml+velocity
verilog verilog, v
vhdl vhdl
VimL vim
WDiff wdiff
Web IDL webidl
Whiley whiley
X10 x10, xten
XQuery xquery, xqy, xq, xql, xqm
XML+Django/Jinja xml+django, xml+jinja
XML+Ruby xml+erb, xml+ruby
XML xml
XML+PHP xml+php
XML+Smarty xml+smarty
Xorg xorg.conf
XSLT xslt
Xtend xtend
xtlang extempore
YAML+Jinja yaml+jinja, salt, sls
YAML yaml
YANG yang
Zeek zeek, bro
Zephir zephir
Zig zig

Develop Base 2021-03-25 05:25:25 location_on

Git - 删除远程仓库分支并提交新分支

Git删除远程仓库分支并提交新分支

# 删除远程分支develop
git branch -r -d origin/origin/develop

# 推送当前分支到远程分支develop
git push origin :origin/develop

Develop Base Git 2021-02-04 11:35:02 location_on

Git - 忽略规则和.gitignore规则不生效解决方案

把某些目录或文件加入忽略规则,按照上述方法定义后发现并未生效,原因是.gitignore只能忽略那些原来没有被追踪的文件

如果某些文件已经被纳入了版本管理中,则修改.gitignore是无效的。那么解决方法就是先把本地缓存删除(改变成未被追踪状态)

最后再次提交即可

git rm -r --cached .
git add .
git commit -m 'update .gitignore'

Develop Base Git 2021-02-04 11:32:33 location_on

Git - "fatal: unable to auto-detect email address "

Git Push的时候出现警告“fatal: unable to auto-detect email address ”

只需要更改当前仓库下的.git/config文件,在其中加入

[user]
    email = xxx
    user = xxx

即可消除这个警告

Develop Base Git 2021-02-04 11:31:11 location_on

Python - 版本管理Pyenv使用指南

pyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.

官方仓库 - https://github.com/pyenv/pyenv

pyenv是目前管理Python版本的流行方案,对于一台PC上存在多个Python版本的最佳管理方案之一,以下安装基于 Debian10

安装pyenv

sudo apt -y install git gcc libgdbm-dev make patch zlib1g.dev libssl-dev libsqlite3-dev libbz2-dev libreadline-dev

curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash

配置环境变量,这里设定是在当前用户下(Shell环境是ZSH,如果是Bash环境请修改对应 bashrc文件)

vim ~/.zshrc

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

以下是常用命令

# 所有可安装的版本列表
pyenv install -list    

# 下载制定版本的Python
pyenv install 3.6.9

# 查看当前已下载的版本
pyenv versions

# 设置系统的Python版本
pyenv global 3.6.9

# 设置当前目录为某个Python版本
pyenv local 3.6.9

# 更新pyenv
pyenv update

注:Visual Studio Code会自动识别当前目录的pyenv指定的版本,在Terminal进入该目录时也会自动切换到该目录的Python版本

如果你希望的是在同一机器上同一个Pyhon版本不同项目的环境不相同,可参考 virtualenv的使用

Develop Base Python 2021-01-25 00:05:42 location_on

Inno Setup - Windows打包程序配置文件指南

Inno Setup是Jordan Russell和Martijn Laan的Windows程序的免费安装程序

Inno Setup is a free installer for Windows programs by Jordan Russell and Martijn Laan. First introduced in 1997, Inno Setup today rivals and even surpasses many commercial installers in feature set and stability.

下面是仅供参考的配置文件,请注意时效性,随着Inno Setup版本更迭配置文件中的部分信息可能失效

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "HelloWorld"
#define MyAppVersion "0.9"
#define MyAppPublisher "chancel's company"
#define MyAppURL "https://www.chancel.ltd/"
#define MyAppExeName "helloworld.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{8435E930-A931-4967-8844-46X547X3BD8D}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={userappdata}\{#MyAppName}
DisableProgramGroupPage=yes
DisableDirPage=no
;安装包的输出目录
OutputDir=D:\inno\output\{#MyAppName}
OutputBaseFilename={#MyAppName}_v{#MyAppVersion}
; 安装包的图标
;SetupIconFile=D:\inno\input\ico\_logo.ico
Compression=lzma
SolidCompression=yes
;此处 限制Windows最低版本为Windows 7
MinVersion=0.0,6.0


[Languages]
;安装语言许选择
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"

[Tasks]
;创建桌面快捷键
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone

[Files]
;打包源文件与要安装的目标文件夹,DestDir需要参考官网文档,有多个枚举可选择
Source: "D:\inno\input\Release\*"; DestDir: "{app}\"; Flags: recursesubdirs ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
;图标选择
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
;程序安装成功后入口执行程序
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

Develop Base 2021-01-20 16:02:28 location_on

MariaDB - "'Access denied for user 'root'@'localhost"

安装的MariaDB登录root账户

chancel@ubuntu1804-server:~$ mysql -uroot -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

chancel@ubuntu1804-server:~$ mysql -V
mysql  Ver 15.1 Distrib 10.1.47-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

登录失败,确认过Root的密码没有错,使用 sudo mysql -p可以登录,确认是Root用户不允许使用密码登录

参考ERROR 1698 (28000): Access denied for user 'root'@'localhost'解决方案一,可以设置root用户允许使用密码登录

chancel@ubuntu1804-server:~$ sudo mysql -u root

MariaDB [(none)]> USE mysql;
MariaDB [mysql]> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
MariaDB [mysql]> FLUSH PRIVILEGES;
MariaDB [mysql]> exit;

再次尝试,可以使用密码登录root账户

Develop Base Database 2021-01-19 11:48:54 location_on

Git - 快速使用Git标签标记发布版本

像其他版本控制系统(VCS)一样,Git 可以给仓库历史中的某一个提交打上标签,以示重要。

Git支持两种标签 轻量标签与附注标签(lightweight/annotated),版本标签推荐使用 附注标签

给特定Commit打标签的Git语法如下

# 附注标签
git tag -a [version] -m [comment] [commitID]
# 轻量标签
git tag [version] -m [comment] [commitID]

以实际例子来看看,首先假设当前要提交的版本号为V2.0.0,当前的提交CommitID为06551e1fac

给06551e1fac打上标签

# 附注标签例子
git tag -a v2.0.0 -m "V2.0.0 Version" 06551e1fac
# 轻量标签例子
git tag v2.0.0 -m "V2.0.0 Version" 06551e1fac

标签创建后只存在于本地,如果需要推送到远程仓库,那么需要显式推送

# 单次推送2.0.0标签
git push origin v2.0.0
# 推送所有的标签
git push origin --tags

其他常见操作如下

签出标签(PS:常见于修复旧版本的问题,但请注意签出后本地仓库状态处于 detached 状态,所以要修复旧版本中的错误,建议签出并新建为分支)

# 签出2.0.0版本并创建为v2.0version分支
git checkout -b v2.0version v2.0

删除标签

# 删除本地标签
git tag -d v2.0.0
# 删除远程仓库标签
git push origin --delete v2.0.0

查看标签

# 列出标签列表
git tag
# 查看与2.0版本相关的标签
git tag -l v2.0.0
# 查看标签的详细内容
git show v2.0.0

Develop Base Git 2020-11-04 08:01:40 location_on

1 of 2 | A total of 20