git config --global user.name "xxd"
git config --global user.email "ssd@163.com"
免密钥登录(本地和远程),配置SSH
在本地配置:
ssh-keygen -t rsa -C "ssd@163.com" 会生成两个文件,后缀是pub文件打开,复制文本放在远程的github ssh key里
发送给远程:
在git上面 setting->SSH and GPS keys
测试连通性:
ssh -T git@github.com
本地新建git项目:
git init
新建远程项目:
https://github.com/ssd/flash.git
本地-远程关联:
git remote add origin https://github.com/ssd/sd.android.git
git remote add origin https://github.com/ssd/vince.nce.git
git remote add origin git@github.dss/dsd.git
https://github.com/ssd/sd.android.git
更新远程代码:
git pull --rebase origin master
推送本地代码
git push -u origin master
git rm -r --cached gradle
git commit -m "删除文件"
git push
create a new repository on the command line
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:zhesju/vinceRepository.git
git push -u origin master
push an existing repository from the command line
git remote add origin git@github.com:zhswdu/vinceRepository.git
git push -u origin master
清空数据:
git add -u; git commit -m "commit deleted files"; git push -u origin master
查看远程仓库
git remote -v
控制台输出
origin https://github.com/user1/myRepository.git (fetch)
origin https://github.com/user1/myRepository.git (push)