2013-11-01 4 views
0

У меня есть репозиторий git на сервере, я должен нажать и потянуть в него свои данные. Когда я пытался вытащить один экземпляр, многие мои файлы были удалены, хотя он присутствует в репозитории. Команды я использовал приведены нижеGit не вытаскивает файлы в репозитории

git add . 
git add -u 
git commit -m 'comments' 
git pull origin master 

Это то, что происходит в терминале на выполнения этих команд

[email protected]:/var/www/MobpazAdmin$ git add . 
[email protected]:/var/www/MobpazAdmin$ git add -u 
[email protected]:/var/www/MobpazAdmin$ git commit -m 'with add ads' 
[master 5706969] with add ads 
Committer: Manesh <[email protected](none)> 
Your name and email address were configured automatically based 
on your username and hostname. Please check that they are accurate. 
You can suppress this message by setting them explicitly: 

git config --global user.name "Your Name" 
git config --global user.email [email protected] 

After doing this, you may fix the identity used for this commit with: 

git commit --amend --reset-author 

10 files changed, 523 insertions(+), 5 deletions(-) 
create mode 100755 src/Mobpaz/AdminBundle/Controller/AdsController.php 
create mode 100644 src/Mobpaz/AdminBundle/Entity/Ads.php 
create mode 100644 src/Mobpaz/AdminBundle/Entity/AdsRepository.php 
create mode 100644   src/Mobpaz/AdminBundle/Resources/config/doctrine/metadata/orm/Ads.orm.xml 
create mode 100755 src/Mobpaz/AdminBundle/Resources/views/Ads/addads.html.twig 
create mode 100755 src/Mobpaz/AdminBundle/Resources/views/Ads/index.html.twig 
mode change 100644 => 100755 src/Mobpaz/AdminBundle/Resources/views/Logs/index.html.twig 
[email protected]:/var/www/MobpazAdmin$ git pull origin master 
[email protected]'s password: 
remote: Counting objects: 50, done. 
remote: Compressing objects: 100% (26/26), done. 
remote: Total 28 (delta 14), reused 0 (delta 0) 
Unpacking objects: 100% (28/28), done. 
From 192.168.10.241:/var/www/repositories/Mobpaz/MobpazAdmin 
* branch   master  -> FETCH_HEAD 
Auto-merging src/Mobpaz/AdminBundle/Resources/views/base.html.twig 
Auto-merging src/Mobpaz/AdminBundle/Resources/views/Logs/index.html.twig 
Auto-merging src/Mobpaz/AdminBundle/Resources/config/routing.yml 
CONFLICT (content): Merge conflict in src/Mobpaz/AdminBundle/Resources/config/routing.yml 
Automatic merge failed; fix conflicts and then commit the result. 
[email protected]:/var/www/MobpazAdmin$ git add . 
[email protected]:/var/www/MobpazAdmin$ git add -u 
[email protected]:/var/www/MobpazAdmin$ git commit -m 'with add ads' 
[master 0c0e548] with add ads 
Committer: Manesh <[email protected](none)> 
Your name and email address were configured automatically based 
on your username and hostname. Please check that they are accurate. 
You can suppress this message by setting them explicitly: 

git config --global user.name "Your Name" 
git config --global user.email [email protected] 

After doing this, you may fix the identity used for this commit with: 

git commit --amend --reset-author 

[email protected]:/var/www/MobpazAdmin$ git commit -m 'with add ads' 
# On branch master 
nothing to commit (working directory clean) 
[email protected]:/var/www/MobpazAdmin$ git pull origin master 
[email protected]'s password: 
From 192.168.10.241:/var/www/repositories/Mobpaz/MobpazAdmin 
* branch   master  -> FETCH_HEAD 
Already up-to-date. 

I разрешило конфликт, который произошел в первом тянуть, прежде чем делать второй. Пожалуйста, скажите мне, что я делаю неправильно, это происходит часто, поэтому моя работа прерывается после каждого нажатия и вытаскивания.

Моя проблема заключается в том, что даже файлы, находящиеся в репозитории, удаляются из моей локальной копии.

+0

Я вижу проблемы с парами, например, git настроен неправильно. вы хотите прочитать 'git config', и если вы« правы », а затем« совершите »и сделаете немедленный« pull' git, вы будете предупреждать вас о «автоматическом слиянии» - простейшими словами, git pull делает git fetch, за которым следует git слияния. – dekdev

ответ

2

Я думаю, вы ошибаетесь, что commit по сравнению с push.

commit Создает локальную зону для вас, с которой вы можете работать. Это полностью локально, и ваш git-сервер не имеет понятия об этих изменениях.

При изменении push ваших изменений (после commit ting) ваш сервер сохранит ваши изменения.

Извините, если я неверно здесь, в ваших журналах просто нет push звонков.

+0

Я предлагаю проверить это: http://git-scm.com/docs/gittutorial – Nava2

+0

, если я зафиксирую и вытащить его, слияние всех файлов в репозитории с моим локальным репозитором будет правильным? – user2655318

+0

Да, но ваши локальные изменения не будут отображаться в удаленном репозитории до тех пор, пока вы не нажмете. – Nava2

Смежные вопросы