git官网下载: https://www.git-scm.com/download/win
生成密匙: ssh-keygen -t rsa -C "email"
在~/.ssh中生成了key,把.pub复制到github的setting中
测试: ssh -T git@github.com
git status
查看文件在工作区还是暂存区还是仓库
git add
将文件从工作区提交到暂存区
git commit -m 提交描述
将文件从暂存区提交到仓库
git config --global user.name ‘name‘
git config --global user.name ‘email‘
cd folder
git init
生成了.git文件,存着本地仓库的信息。
git add filename
提交到暂存区git commit -m ‘提交描述‘
提交到git仓库修改后
git add filename
提交到暂存区git commit -m ‘提交描述‘
提交到git仓库删除工作目录文件后
git rm filename
git commit -m ‘提交描述‘
提交到git仓库git push
把本地仓库同步到远程仓库
将远程仓库复制到本地
git clone 仓库地址
查看config: git config --list
设置账号密码
.git/config
[remote "origin"]
url = https://用户名:密码@github.com/Feibilun/test.git
修改url 使用git协议:
[remote "origin"]
url = git@github.com:Feibilun/test.git
fetch = +refs/heads/*:refs/remotes/origin/*
原文:https://www.cnblogs.com/FEIIEF/p/13269909.html