遇到的所有问题:
warning: LF will be replaced by CRLF in XXXXXXXXXXXXXX.
git config core.autocrlf false
github push 提交代码时停止在writing objects怎么办?
git config –global http.postBuffer 524288000
新建仓库初始化时,不要点击初始化按钮,否则github
就自动建立一个git仓库,并且生成一个版本库
所以这样的话,那你用git push origin master
就会说被拒绝,遇到这种情况要:
git pull origin master
git push origin master
一开始怎么绑定github账号?
- 设置全局用户名和email,作为每次提交的记录
git config --global user.name “name"
git config --global user.email “mail.com”
- 添加一个仓库
git remote add origin git@….git
git push -u origin master
- 当提示权限不够时,添加ssh公钥
- 在用户的.ssh目录下找id_rsa.pub等文件,没有的话去生成
ssh-keygen -t rsa -C "youremail@example.com”
- 设置pull的默认地址
git branch --set-upstream-to=origin/master
- 设置push的默认地址
git remote add origin git@….git
其他tips
- 配置别名
git config --global alias.xx ''
- 临时保存工作区
git stash
git stash pop
- 回滚
git reset —hard 版本号
- 强行回滚远程服务器
git push -f