-
Notifications
You must be signed in to change notification settings - Fork 0
20210115关于git之后的计划
ziyouzy edited this page Jan 15, 2021
·
1 revision
git push -u origin --all
git push -u origin --tags
查询旧本地仓库的远程关联状态:git remote -v
解除旧仓库的当前远程关联:git remote remove origin
创建新关联:git remote add origin https://xxxxxxx/ziyouzy/xxx.git
其实并不需要解除,只要不适用这个origin这个名称即可,但是为了严谨解除关联
https://stackoverflow.com/questions/49343025/git-push-all-vs-mirror
--all
Push all branches (i.e. refs under refs/heads/); cannot be used with other <refspec>.
--mirror
... specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored ...
zqy@ubuntu:~/WorkShop/golang/src/yunhuan_mylib/.git/refs$ ls
heads remotes tags
zqy@ubuntu:~/WorkShop/golang/src/yunhuan_mylib/.git/refs/heads$ ls
buildService master snmpconn
zqy@ubuntu:~/WorkShop/golang/src/yunhuan_mylib/.git/refs/remotes$ ls
origin
zqy@ubuntu:~/WorkShop/golang/src/yunhuan_mylib/.git/refs/tags$ ls
(null)
git push github_yunhuanBackup --mirror
Counting objects: 958, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (871/871), done.
Writing objects: 100% (958/958), 140.66 MiB | 1.08 MiB/s, done.
Total 958 (delta 427), reused 0 (delta 0)
remote: Resolving deltas: 100% (427/427), done.
To [email protected]:ziyouzy/yunhuanBackup.git
* [new branch] buildService -> buildService
* [new branch] master -> master
* [new branch] snmpconn -> snmpconn
! [remote rejected] bak (refusing to delete the current branch: refs/heads/bak)
error: failed to push some refs to '[email protected]:ziyouzy/yunhuanBackup.git'
remote: error: refusing to delete the current branch: refs/heads/bak
To [email protected]:ziyouzy/yunhuan-backup.git
* [new branch] buildService -> buildService
* [new branch] master -> master
* [new branch] snmpconn -> snmpconn
* [new branch] github_yunhuanBackup/buildService -> github_yunhuanBackup/buildService
* [new branch] github_yunhuanBackup/master -> github_yunhuanBackup/master
* [new branch] github_yunhuanBackup/snmpconn -> github_yunhuanBackup/snmpconn
! [remote rejected] bak (deletion of the current branch prohibited)
error: failed to push some refs to '[email protected]:ziyouzy/yunhuan-backup.git'