[請益] push程式碼的問題

看板Soft_Job作者 (不痛)時間6年前 (2017/08/07 22:10), 6年前編輯推噓2(315)
留言9則, 6人參與, 最新討論串1/1
各位大大好,小弟是程式開發的新手,工作上遇到技術上的問題想上來向大家求救。 請問要怎麼把本地檔案push到沒有裝git的遠端呢? 我首先切換到遠端硬碟 cd //J-STATION cd test/t3 git init 然後用Source Tree clone到 G:\xampp\htdocs\t3 本地做修改後 push,結果顯示 ------- git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags --set-upstream origin master:master Pushing to //J-STATION/test/t3 remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branch in a non-bare repository remote: error: is denied, because it will make the index and work tree inconsistent remote: error: with what you pushed, and will require 'git reset --hard' to match remote: error: the work tree to HEAD. remote: error: remote: error: You can set 'receive.denyCurrentBranch' configuration variable to remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into remote: error: its current branch; however, this is not recommended unless you remote: error: arranged to update its work tree to match what you pushed in some remote: error: other way. remote: error: remote: error: To squelch this message and still keep the default behaviour, set remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'. To //J-STATION/test/t3 ! [remote rejected] master -> master (branch is currently checked out) error: failed to push some refs to '//J-STATION/test/t3' ------- 照google解修改遠端J-STATION的 .git/config [receive] denyCurrentBranch = ignore 沒有錯誤訊息,但是J-STATOIN沒有收到新增修改的檔案。 如果是當初是用 git --bare init,則會少一層.git資料夾, 但push後一樣什麼都沒收到。 想請問版上的前輩們有沒有相關經驗分享或建議 或者推個關鍵字讓小弟去查 先謝謝大家了 -- jQuery做事,開口不談$後面啥都別想動。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.26.236.117 ※ 文章網址: https://www.ptt.cc/bbs/Soft_Job/M.1502115036.A.13B.html

08/07 22:32, , 1F
遠端的bare repo 使用 git log 應該會看到新的 commit
08/07 22:32, 1F

08/07 22:32, , 2F
08/07 22:32, 2F
看到了所有commit,git checkout master後有正常更新了, 感謝大大。 只是checkout都要先到低版本再checkout master不然會漏檔案。 ※ 編輯: Allenbootung (114.26.236.117), 08/07/2017 22:42:58

08/07 23:55, , 3F
走錯棚吧..這跟工作職務幾乎無關..跟Google比較有關
08/07 23:55, 3F
我看上面有人問merge就跟著問push。

08/08 03:55, , 4F
說起來,哪個版最適合討論綜合性的軟體技術問題呢?
08/08 03:55, 4F
ask?

08/08 06:44, , 5F
programing?
08/08 06:44, 5F

08/08 06:45, , 6F
重複字尾被吃掉了…
08/08 06:45, 6F

08/08 09:28, , 7F
為什麼要checkout到低版本,用git checkout -f .
08/08 09:28, 7F

08/08 09:28, , 8F
也會漏檔案嗎?
08/08 09:28, 8F
感謝大大,學習了。 ※ 編輯: Allenbootung (114.26.236.117), 08/08/2017 19:03:00

08/09 18:31, , 9F
這是軟體工作版,去技術版問好嗎,知道也不告訴你
08/09 18:31, 9F
文章代碼(AID): #1PY7JS4x (Soft_Job)