-
Notifications
You must be signed in to change notification settings - Fork 0
Home
- <錯誤顯示><br> ! [rejected] master -> master (fetch first)<br> error: failed to push some refs to 'https://github.com/i314i/*****.git<br> hint: Updates were rejected because the remote contains work that you do<br> hint: not have locally. This is usually caused by another repository pushing<br> hint: to the same ref. You may want to first integrate the remote changes<br> hint: (e.g., 'git pull ...') before pushing again.<br> hint: See the 'Note about fast-forwards' in 'git push --help' for details.<br>
- <產生原因>:這是因為在github上面創一個repo的時候,一個readme檔也同時被產生,但local repository並不知道有這個東西,所以出了問題。
- <解決方法>:解決辦法就是輸入git pull把它和local這邊做整合。<br>
輸入:
git pull origin master<br>
git add .<br>
git checkout<br>
git commit<br>
git push<br>
<參考資料>如何提交git<br>
git push [remote] 把檔案push到remote repository的branch,一般來說都是 git push origin master<br> git config --list 查看自己的設定值。<br> git status 查看目前這個repo的檔案狀態。<br> git config --global core.editor [*] 指定編輯器為*<br> git rm -f [filename] 移除filename的暫存,並把它刪除<br> git rm --cached [filename] 移除filename的暫存,成為未追蹤,但不刪除。<br> git mv a b = mv a b + git rm a + git add b<br> git log 看以前的log<br> git checkout [filename] 復原己修改的filename<br> git commit --amend 更動最後一次提交<br> git reset head [filename] 取消被暫存的filename<br> git remote show [remote] 查看remote repository的狀況<br> git config --global alias.[short] [command] 將command alias 為short<br> git branch [branchname] 新增一個為branchname 的branch<br> git checkout [branchname] 將HEAD移到branchname的branch<br> git branch -d [branchname] 刪除branchname<br> <參考資料>初用git和github——一些簡單指令的筆記<br>