git操作
## 本地初始化
git init
## 设置账号
git config --global user.name "Your Name"
##设置密码
git config --global user.password "xxxxxx"
##设置邮箱
git config --global user.email "3469001524l@qq.com"
##添加到暂存区
git add .
##查看当前状态
git status
##本地提交
git commit -m 'xxxx'
##推送到远程
git push -u master
##强制推送会覆盖远程仓库的历史记录,可能导致团队协作中的代码丢失,仅在个人仓库或明确需求时使用
git push -f origin master
## 查看当前的远程仓库关联
git remote -v
## 解除远程仓库关联
git remote remove origin
##HTTPS 方式(需要输入用户名和密码/Token)
git remote add origin https://github.com/your-username/your-repo.git
## SSH 方式(需要配置 SSH Key)
git remote add origin git@github.com:your-username/your-repo.git
浙公网安备 33010602011771号