git常用
常用命令 git config credential.helper store 保存账号密码到本地 git init 初始化仓库 git add . 添加所有文件到版本控制中 git commit -m "init" 提交文件,提交信息为 “init” git commit --amend 继上一次提交合并一起提交,提交信息为上一次提交信息 git remote add origin https://xxx.com 关联远程仓库地址 git push --set-upstream origin master 初次推送本地仓库至远程 git relog 查看 git 操作日志 git checkout -b commitId 已某个 commit 为基点创建 新分支 git apply commitId 应用某次提交的内容 git rebase git pull 常见场景 初始化仓库 git init 关联远程仓库 如果是更改远程仓库地址,需要先删除远程仓库关联 git remote remove origin,然后再关联到新的远程仓库git remote add $url 切换分支 git switch other-branch 或者 git checkout other-branch ,两个命令都表示切换到 other-branch 分支...