報錯訊息
root@k8s-master71u:/data/docker-elk# git push -u origin main
error: src refspec main does not match any
error: failed to push some refs to 'https://github.com/chingtsechen/docker-elk.git'
解決方式: 修改master為main
root@k8s-master71u:/data/docker-elk# git init
# 這裡需要修改master為main
root@k8s-master71u:/data/docker-elk# git branch -m master main
root@k8s-master71u:/data/docker-elk# git add .
root@k8s-master71u:/data/docker-elk# git commit -m "first commit"
root@k8s-master71u:/data/docker-elk# git branch -M main
root@k8s-master71u:/data/docker-elk# git remote add origin https://github.com/chingtsechen/docker-elk.git
root@k8s-master71u:/data/docker-elk# git push -u origin main
Username for 'https://github.com': chingtsechen
Password for 'https://[email protected]':
Enumerating objects: 85, done.
Counting objects: 100% (85/85), done.
Delta compression using up to 8 threads
Compressing objects: 100% (74/74), done.
Writing objects: 100% (85/85), 34.36 KiB | 3.12 MiB/s, done.
Total 85 (delta 11), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (11/11), done.
To https://github.com/chingtsechen/docker-elk.git
* [new branch] main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.