我經常需要開發的東西的道路上,沒有互聯網/網絡連接。我只是一個單一的開發人員,所以到現在爲止,我只是有我的機器上的SVN倉庫,做了結帳我的筆記本電腦時,我走了。問題:這使我無法在道路上進行源控制。混帳設置單個開發者?
所以我嘗試了改變,以混帳,這似乎做我想做的,但我不知道我的理解正確它應該如何在我的設置中使用。
本質:
- 創建使用
git init
- 克隆使用
git clone
- 該倉庫機器1克隆該庫以機2使用
git clone
- 曾爲\ MYSERVER \共享\項目資源庫上機2臺,使用
git commit
承諾我的本地庫 - F所列的變化inally使用
git push
推的所有更改到\ MYSERVER \共享\ prohect - 機1上使用的
git pull
擺脫\ MYSERVER \共享\項目的最新變化
這樣的作品,但git push
命令給了我警告說不支持推出檢出分支,因爲它可能會混淆索引。現在,我很困惑,因爲信息也是用嚴肅的語氣寫成的,這意味着我應該尊重它(事實上,gitk表明我現在有兩個分支:master和remotes/origin/master),但是我還沒有完全理解術語。
什麼將是我的情況正確的步驟?
- 我會計算機1或計算機2上只有永遠的工作,不必在兩個
- 我打算用分支的方式來對錯誤修正/測試一個單獨的分支(就像在通常的方式),但不是讓多個開發人員的方式
- 我真的主要想用它來替代rsync我的SVN。
編輯:有兩個古怪。第一個是如果我簡單地更改文件,它會顯示「已更改但未更新」。這是奇怪的:
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: myproject/Readme.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
第二條消息是一個我認爲是罪魁禍首,混帳推的輸出:
warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: that exist both locally and remotely will be updated. This may
warning: not necessarily be what you want to happen.
warning:
warning: You can specify what action you want to take in this case, and
warning: avoid seeing this message again, by configuring 'push.default' to:
warning: 'nothing' : Do not push anything
warning: 'matching' : Push all matching branches (default)
warning: 'tracking' : Push the current branch to whatever it is tracking
warning: 'current' : Push the current branch
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 333 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
warning: updating the current branch
warning: Updating the currently checked out branch may cause confusion,
warning: as the index and work tree do not reflect changes that are in HEAD.
warning: As a result, you may see the changes you just pushed into it
warning: reverted when you run 'git diff' over there, and you may want
warning: to run 'git reset --hard' before starting to work to recover.
warning:
warning: You can set 'receive.denyCurrentBranch' configuration variable to
warning: 'refuse' in the remote repository to forbid pushing into its
warning: current branch.
warning: To allow pushing into the current branch, you can set it to 'ignore';
warning: but this is not recommended unless you arranged to update its work
warning: tree to match what you pushed in some other way.
warning:
warning: To squelch this message, you can set it to 'warn'.
warning:
warning: Note that the default will change in a future version of git
warning: to refuse updating the current branch unless you have the
warning: configuration variable set to either 'ignore' or 'warn'.
To file:///\\myserver\share\project
129649b..1f4b957 master -> master
所以它告訴我,「推進當前的分支」是不推薦,但我真的不明白這樣做的正確方法。
我使用git來解決同樣的問題。我不是有同樣的問題,但我有點不同。我在家使用一臺linux服務器作爲中央存儲庫,然後我所有的開發地點都是中央的克隆。你能複製確切的錯誤信息嗎?這可能會幫助我更好地回答你的問題。 – 2009-06-27 14:11:41
這有幫助。你有幾個很好的答案,來自其他人,我正在投票。 – 2009-06-27 15:06:31