Egit push 不会更改远程存储库中的文件 [英] Egit push doesn't change files in remote repository

查看:41
本文介绍了Egit push 不会更改远程存储库中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上周我开始了解 git/egit 版本控制系统,这似乎太好了,难以置信.所以想从 SVN 转移到 git..因为上周我试图了解 git 的基础知识和概念.

I came to know about the git / egit version control system last week, seems too good to be true .So thought to shift from SVN to git..Since last week I am trying to understand the basics and concepts of git.

所以我创建了一个测试环境来理解eclipseegit的工作流程,如下所示.

So I created a test environment for understanding the workflow of egit in eclipse as following.

我遵循远程跟踪策略,有两个名为 local 和 remote 的存储库用于理解工作流程.

I am following the strategy of remote tracking there are two repositories named local and remote used for understanding the workflow.

  1. 我使用一个 emtpy index.php 文件创建了一个名为remote"的存储库,并有一个主分支并将项目导入到 eclipse 中.

  1. I created a repository named 'remote' with an emtpy index.php file and has one master branch and imported the project into eclipse.

我通过克隆上面的 'remote' git repo 创建了另一个名为 'local' 的 git 仓库,这个仓库现在被 'remote 跟踪' 仓库有一个 master 分支和一个 origin/master 远程跟踪分支.

I created another git repository named 'local' by cloning the above 'remote' git repo, this repository is now tracked by 'remote' repository has one master branch and origin/master remote tracking branch.

我从 'local' git repo 导入了项目.进入我的 eclipse 工作台并使用 eclipse php 编辑器 -> 更改了 index.php 文件,将更改提交到本地的 master 分支,并且 -> 从执行推送本地主分支.

I imported the project from 'local' git repo. into my eclipse workbench and changed the index.php file using eclipse php editor -> committed changes to local's master branch and -> performed push from local master branch.

检查远程工作目录时..没有更新我在本地的 index.php 文件中所做的更改,但是远程存储库视图中的 master 分支显示了我的最新提交在本地的主分支中提交,但不幸的是文件没有更新,它只是在我的远程项目视图中为所有更改的文件添加星号标记.

When checking the remote working directory .. there is no change updated which I did in local's index.php file , however master branch in the remote repository view shows the latest commit which I committed in the local's master branch, but unfortunately files are not updated, it just adds asterisk mark to all changed files in my remote project view.

所以研究星号标记我发现它处于阶段性状态.所以任何人都可以引导我以正确的方式解释如何成功地执行推送操作从本地的主分支到远程的分支我将不胜感激.

So researching about the asterisk mark I found its in staged condition .So can anyone lead me to the right way explaining how to successfully perform push operation from local's master branch to remote's branch I will be grateful.

这是我在 eclipse 中设置的用于理解工作流程的 egit 测试用例 的图片.从本地仓库推送后可以在远程项目中看到星号,可以看到所有三个分支viz.local的masterorigin/masterstrong> 和 remote's master 分支显示相同的最新提交.

this is the picture of my egit test case set up in eclipse for understanding the workflow. you can see the asterisk mark in the remote project after performing push from local repository,you can see all three branches viz.local's master, origin/master and remote's master branches shows same latest commit.

1

谢谢.

推荐答案

我尝试使用裸仓库.作为远程,当我将更改从本地推送到远程时,我在远程仓库中找不到任何文件.只需使用最新提交更新分支即可.

I tried using bare repo. as a remote, when I push from changes from local to remote, I don't find any files in remote repo. Just branch gets updated with the latest commit.

这似乎很正常,因为 repo *没有工作树,这意味着没有文件.

That seems normal, since a bare repo has *no working tree, meaning no files.

您需要克隆该远程存储库,并将此克隆的存储库(非裸)添加为 Eclipse 中的一个项目,以便:

You would need to clone that remote repo, and add this cloned repo (non-bare) as a project in your Eclipse, in order to:

  • 从你的第一个 Egit 管理的仓库推送到裸远程仓库
  • 从同一个裸仓库拉取到你的第二个 Egit 管理的非裸仓库.

这篇关于Egit push 不会更改远程存储库中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆