1. 本地创建新项目
git init git add . git commit -m "First commit"
2. 本地代码同步Push到远程仓库
git remote add origin "https://github.com/zwffff/ag.git" git push -u origin master
3. push到远程仓库,出现“failed to push some refs to git"错误
git pull --rebase origin master
4. git pull --rebase origin master,出现“Cannot pull with rebase: You have unstaged changes."错误
git stash git pull --rebase origin master
5. 创建.gitignore忽略文件
touch .gitignore
6. git 更改远程仓库地址
git remote rm origin git remote add origin [url]