viiyu / memo

0 stars 0 forks source link

git #1

Open viiyu opened 5 years ago

viiyu commented 5 years ago

删除本地分支

#  which would delete the local branch, only if you 
# have already pushed and merged it with your remote branches
git branch -d branch_name   
git branch -D branch_name  // --delete --force
viiyu commented 5 years ago

mirror镜像版本更新

假设我在github上有个A.git,在gitlab上维护了一个A-mirror.git,如何从A.git同步数据,方法如下

  1. git clone --mirror https://github.com/A.git
  2. cd A
  3. git remote add --mirror=push mirror http://gitlab.com/A-mirror.git
  4. git push --mirror mirror

反过来也是可以的,只是各自对应的origin不一样,可以用git remote -v查看:

  1. git clone --mirror http://gitlab.com/A-mirror.git
  2. cd A-mirror
  3. git remote add --mirror pb https://github.com/A.git
  4. git remote update
  5. git push --mirror origin
viiyu commented 5 years ago

删除tag

viiyu commented 5 years ago

删除分支

viiyu commented 5 years ago

回退到上一个版本