У меня есть сервер (доступный через ssh) в Интернете, который мой друг и я используем для совместной работы над проектами. Мы начали использовать git для контроля источника. Наша установка в настоящее время выглядит следующим образом:github как рабочий процесс на частном сервере по ssh
- Друг создал репозиторий на
server
сgit --bare init
именемproject.friend.git
- Я клонировал
project.friend.git
наserver
кproject.jesse.git
- Я клонировал
project.jesse.git
наserver
к моей локальной машине, используяgit clone [email protected]:/git_repos/project.jesse.git
- Я работаю на своей локальной машине и фиксирую ее на локальной машине. Когда я хочу нажать мои изменения на
project.jesse.git
наserver
, я используюgit push origin master
. Мой друг работает наproject.friend.git
. Когда я хочу получить его изменения, я делаюpull [email protected]:/git_repos/project.friend.git
.
Все, кажется, работает нормально, однако, сейчас я получаю следующее сообщение об ошибке, когда я git push origin master
:
localpc:project.jesse jesse$ git push origin master
Counting objects: 100, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (76/76), done.
Writing objects: 100% (76/76), 15.98 KiB, done.
Total 76 (delta 50), reused 0 (delta 0)
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 [email protected]:/git_repos/project.jesse.git
c455cb7..e9ec677 master -> master
Это предупреждение все, что я должен быть обеспокоены? Как я уже сказал, все работает. Мой друг может вытащить мои изменения из моей ветки. У меня есть клон на сервере, чтобы он мог получить к нему доступ, так как у него нет доступа к моей локальной машине. Есть ли что-то, что можно было бы сделать лучше?
Спасибо!
Вы уверены, что ваш 'мастер' указывает на' project.jesse.git'? –
@matt b, я бы предположил, что это происходит, так как изменения, которые я посылаю мастеру, не отображаются в project.friend.git, пока он не вытащит их в себя. –