我在git中爲零。絕對零度。所以網上有很多材料和提示,但是我不能把它們放在一起。Git本地庫所有步驟
所以有人可以告訴我我做錯了什麼,還有什麼我應該做的,以實現我在找什麼?
我想要做的事很簡單。我已經使用C++編寫了一個項目,現在我想創建一個本地存儲庫來對我的所有更改進行版本控制。這就是我需要的。
我有一個文件夾:
~/myproject
其中包含我的項目文件。而另一個文件夾來保存裏面(我本地的地方保存的更改)
~/my-local-repository
所以,首先,我建立了一個回購:
cd ~/myproject
git init
然後我創建了一個的.gitignore:
cd ~/myproject
touch .git/.gitignore
並排除我的bin
目錄。
然後我加了幾個文件
git add this that
然後我把他們趕走
git reset
,並再次增加了一些文件。我改變了一些文件,並承諾:
git commit -am "new change"
然後設定虛擬用戶名和電子郵件:
git config user.name "my.phd"
git config user.email [email protected]
然後我設置爲本地更改本地資源庫中的文件夾:
git remote add local ~/my-local-repository
所以我希望我所有的改變都在這裏。
現在,當我推:
git push local
我得到這個錯誤:
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
In Git 2.0, Git will default to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
fatal: '/media/doc/my-local-repository' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
也許這個錯誤是很多人非常簡單。但我對此一無所知。我到現在爲止做了什麼錯誤以及如何解決?
[Warning:push.default is unset;其隱含的價值正在改變Git 2.0](http://stackoverflow.com/questions/13148066/warning-push-default-is-unset-its-implicit-value-is-changing-in-git-2-0) – 2015-03-02 14:22:14
@ Pierre-Jean我不明白解決方案 – ar2015 2015-03-02 14:24:42
@ Pierre-Jean,另一個鏈接解決警告,但不是致命的錯誤。 – tom 2015-03-02 14:25:14