关联远程仓库
git remote add origin [远端仓库地址]
如:git remote add origin http://kb-webide
创建分支
1 | // 创建本地分支 |
查看分支
1 | // 列出分支名 |
切换分支
1 | // 切换到其他分支 |
恢复暂存区文件到工作区
git checkout .
等于是撤销操作
删除分支
1 | 1. git branch -d [分支名] // 删除本地分支 |
删除github文件夹
1 | 1. git rm -r --cached [文件夹名] // --cached不会删除本地的对应文件 |
删除本地文件
1 | git rm 文件路径(src/test.vue) |
抽取提交合并到其他分支
1 | git cherry-pick commitId |
版本回滚
1 | git log |
git同步代码到Coding和Github
修改.git文件夹下的config文件
1
2
3
4
5
6
7
8
9
10
11
12
13[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = git@github.com:Evermenot/Evermenot.github.io.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "second"]
url = git@git.dev.tencent.com:Evermenot/Evermenot.git
fetch = +refs/heads/*:refs/remotes/second/*代码push命令
1
git push second hexo