簡體   English   中英

Git沒有在存儲庫中提取文件

[英]Git not pulling files in the repository

我在服務器中有一個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.

我解決了在第二次拉動之前發生的沖突。 請告訴我,我做錯了這種情況經常發生,因此我的工作在每次推拉后都會中斷。

我的問題是,即使存儲庫中的文件也會從我的本地副本中刪除。

我認為你錯誤地認為commitpush相比。

commit創建一個本地暫存區域供您使用。 這是完全本地的,您的git服務器沒有這些更改的概念。

當您push更改時( commit后),您的服務器將保留您的更改。

對不起,如果我在這里不正確,你的日志就沒有任何push電話。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM