克隆倉庫到本地
git clone 這里寫倉庫地址
如果已經(jīng)配置SSH key熔恢,克隆的時候倉庫地址記得選SSH地址
更新文件
進(jìn)入項目所在本地文件夾磕秤,右鍵-git bash here
git add . (全部文件)
git add filename (需要更新的文件名稱)
git commit -m "提交信息"
git push -u origin main
如果報錯: Updates were rejected because the remote contains work that you do hint: not have locally.
則需要先git pull,再push
https://blog.csdn.net/shizhenweiszw/article/details/87486195
報錯:Your configuration specifies to merge with the ref 'refs/heads/master'
from the remote, but no such ref was fetched.
解決辦法:
git init
報錯:‘origin‘ does not appear to be a git repository
解決辦法:
git remote add origin 這里寫git倉庫地址
報錯: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
解決辦法:
先pull再push:
git pull
會提示:Please enter a commit message to explain why this merge is necessary
解決辦法:
可以直接下面3,4步退出黑框捧韵。如果要輸入解釋的話就需要1-4步:
1.按鍵盤字母 i 進(jìn)入insert模式
2.修改最上面那行黃色合并信息,可以不修改
3.按鍵盤左上角"Esc"
4.輸入":wq",注意是冒號+wq,按回車鍵即可
(https://lijunde.blog.csdn.net/article/details/89047553?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-3.control
)
刪除分支
git push origin --delete 分支名稱