我是新手混帳。我在bitbucket上有一個倉庫。現在我想在工作中將其下載到計算機上,並對項目進行一些更改,然後重新推送。如何在新計算機上同步我的git存儲庫?
首先我初始化上的本地目錄混帳通過這條線:
$ git init
然後我設置一些配置:
$ git config --global user.name "my name"
$ git config --global user.email [email protected]
然後我下載這樣的:
現在我可以在我的本地文件夾中看到項目的文件。好,好!
而且我做了這個命令我的倉庫,我的本地目錄之間的連接:
$ git remote add origin https://[email protected]/ ...
現在,當我進入$ git remove -v
,結果將是:
origin https://[email protected]/ ... (fetch)
origin https://[email protected]/ ... (push)
似乎不錯!
當我輸入以下命令:git status
,我會看到紅色的所有文件夾/文件。因爲我輸入了這個命令:
$ git add .
現在他們是綠色的!我也寫了一本線提交它:
$ git commit -m "there isn't any change"
然後同步我的本地目錄與到位桶一個,我進入這一行:
$ git push origin master
但我得到這個錯誤:
$ git push origin master
To https://bitbucket.org/lamtakam/lamtakam.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://[email protected]/lamtakam/lamtakam.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
怎麼回事,我該如何解決?
它不起作用https://i.stack.imgur.com/1TfMV.png – stack
你確定你在主分支? (git狀態輸出) –
https://i.stack.imgur.com/vHfB7.png – stack