设置用户信息git
git config -global user.name "your name" git config -global user.email youremail@email.com
初始化仓库github
git init
加入文件数据库
git add *.c git commit -m 'Your Information'
克隆现有仓库安全
git clone https://github.com/elegantking/PythonSpiderGuide
若是想定义本地的仓库名称,能够使用在后面加入本身的名称,例如服务器
git clone https://github.com/elegantking/PythonSpiderGuide MyPythonProject
检查当前文件状态ide
git status
查询文件更新哪些部分fetch
git diff
删除指定文件ui
git rm file
查看提交历史code
git log
显示每次提交的内容差别orm
git log -p -2
查看已经配置的远程仓库服务器
git remote
从远程仓库中获取新的数据
git fetch [remote-name]
推送到远程仓库
git push
移除远程仓库
git remote rm [remote-name]
建立分支
git branch [name]
切换到指定分支
git checkout [name]
合并分支
git merge [name]