我在服务器中有一个 git 存储库,我必须将数据推送和拉入其中。当我试图拉取一个实例时,我的很多文件都被删除了,即使它存在于存储库中。我使用的命令如下
git add .
git add -u
git commit -m 'comments'
git pull origin master
这是在终端运行这些命令时发生的情况
manesh@sysadmin-PC:/var/www/MobpazAdmin$ git add .
manesh@sysadmin-PC:/var/www/MobpazAdmin$ git add -u
manesh@sysadmin-PC:/var/www/MobpazAdmin$ git commit -m 'with add ads'
[master 5706969] with add ads
Committer: Manesh <manesh@sysadmin-PC.(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 you@example.com
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
manesh@sysadmin-PC:/var/www/MobpazAdmin$ git pull origin master
git@192.168.10.241'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.
manesh@sysadmin-PC:/var/www/MobpazAdmin$ git add .
manesh@sysadmin-PC:/var/www/MobpazAdmin$ git add -u
manesh@sysadmin-PC:/var/www/MobpazAdmin$ git commit -m 'with add ads'
[master 0c0e548] with add ads
Committer: Manesh <manesh@sysadmin-PC.(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 you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
manesh@sysadmin-PC:/var/www/MobpazAdmin$ git commit -m 'with add ads'
# On branch master
nothing to commit (working directory clean)
manesh@sysadmin-PC:/var/www/MobpazAdmin$ git pull origin master
git@192.168.10.241's password:
From 192.168.10.241:/var/www/repositories/Mobpaz/MobpazAdmin
* branch master -> FETCH_HEAD
Already up-to-date.
在进行第二次拉动之前,我解决了第一次拉动中发生的冲突。请告诉我我做错了什么这种情况经常发生,因此我的工作在每次推拉后都会被打断。
我的问题是,即使存储库中的文件也会从我的本地副本中删除。