1. 本地建立新項目git
git init git add . git commit -m "First commit"
2. 本地代碼同步Push到遠程倉庫github
git remote add origin "https://github.com/zwffff/ag.git" git push -u origin master
3. push到遠程倉庫,出現「failed to push some refs to git"錯誤url
git pull --rebase origin master
4. git pull --rebase origin master,出現「Cannot pull with rebase: You have unstaged changes."錯誤spa
git stash git pull --rebase origin master
5. 建立.gitignore忽略文件code
touch .gitignore
6. git 更改遠程倉庫地址blog
git remote rm origin git remote add origin [url]