每一个不曾起舞的日子,都是对生命的辜负

用户工具

站点工具


git:start

Git标签

git tag v1.1 -m“说明信息”

git show v1.1

删除tag

git tag -d v1.1

tag 推送

git push origin tag v1.1

git push -f origin master 强制推送

git初始化

git config –global user.name “填写自己的用户名” # 配置个人用户名

git config –global user.email 填写自己的邮箱号 #电子邮件地址


Git查看远程分支、本地分支、创建分支

1.查看本地分支

$ git branch
* br-2.1.2.2
  master

2.查看远程分支

$ git branch -r
  origin/HEAD -> origin/master
  origin/feature/IOS_visualtrack
  origin/feature/android_visualtrack
  origin/master

3.查看所有分支

$ git branch -a
* br-2.1.2.2
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/br-2.1.2.1
  remotes/origin/br-2.1.2.2
  remotes/origin/br-2.1.3
  remotes/origin/master
 
 $git branch --remote 查看远程分支

4.切换远程分支

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/Release
  remotes/origin/master
 
$ git checkout -b myRelease origin/Release
Branch myRelease set up to track remote branch Release from origin.
Switched to a new branch 'myRelease'

作用是checkout远程的Release分支,在本地起名为myRelease分支,并切换到本地的myRelase分支

5.合并分支

合并前要先切回要并入的分支

以下表示要把issue1234分支合并入master分支

$: git checkout master
$: git merge issue1234
Merge made by recursive.
 README |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

6. 其他Checkout

    git checkout branch_name 切换某个分支
 
    git checkout -b branch_name 以当前分支未基础建立新分支并且切换过去
 
    git checkout -f 强制替换与分支不一样的文件
 
    git checkout path 撤销某个未提交文件恢复原状
 
    git checkout . 撤销所有未提交文件恢复原状
 
    git checkout --ours path  冲突中以当前分支未基准
 
    git checkout --theirs path 冲突中以对方分支未基准''


使用技巧

解决git Clone 太慢问题

要开vpn

git config –global http.proxy socks5:127.0.0.1:1080

git config –global https.proxy socks5:127.0.0.1:1080

取消指令:

git config –global –unset http.proxy

git config –global –unset https.prox


git config --global https.proxy http://127.0.0.1:1080
 
git config --global https.proxy https://127.0.0.1:1080
查询是否使用代理:git config --global http.proxy
取消代理:git config --global --unset http.proxy
git config --global --unset http.proxy
 
git config --global --unset https.proxy
 
npm config delete proxy
 
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'

Git报错解决:OpenSSL SSL_read: Connection was reset, errno 10054 错误解决

git config --global http.sslVerify "false"
git/start.txt · 最后更改: 2021/08/17 18:55 由 stone

页面工具