Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349180

Summary: push of new file to remote repo loses the file
Product: [Technology] EGit Reporter: Edwin Lukaweski <serjann>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: matthias.sohn
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
screenshot: gitk showing a local non-committed change none

Description Edwin Lukaweski CLA 2011-06-13 08:13:02 EDT
Build Identifier: 

If I have added a new directory and file in my local branch (and repo) and I then push these changes to a remote (after doing a commit), the new directory and file are not present in the remote repo. Further, when I look at the log of the remote repo, via another GIT viewer, I see a commit, on the master branch, with the comment "working dir changes" and the result that the directory and file have been deleted from the remote repo. Also, this commit has a hash of "000...000" (all zeros).
Why is this happening?

Reproducible: Always
Comment 1 Matthias Sohn CLA 2011-06-29 07:50:24 EDT
(In reply to comment #0)
> Build Identifier: 
> 
> If I have added a new directory and file in my local branch (and repo) and I
> then push these changes to a remote (after doing a commit), the new directory
> and file are not present in the remote repo. 

Did you commit your change before pushing ?

> Further, when I look at the log of
> the remote repo, via another GIT viewer, I see a commit, on the master branch,
> with the comment "working dir changes" and the result that the directory and
> file have been deleted from the remote repo. Also, this commit has a hash of
> "000...000" (all zeros).

Which Git viewer are you using here? This looks like a local modification you did in your working directory without committing it to the local repository. If that's true everything works as designed as push only transfers changes committed to the local repository.

I tried that with gitk on some local uncommitted change using gitk as git viewer
and it looks like this is what you describe here. See attached screenshot.
Comment 2 Matthias Sohn CLA 2011-06-29 07:51:49 EDT
Created attachment 198820 [details]
screenshot: gitk showing a local non-committed change

marked what you described with red frames
Comment 3 Matthias Sohn CLA 2011-06-29 07:52:42 EDT
Seems to work as designed
Comment 4 Edwin Lukaweski CLA 2011-06-29 11:04:03 EDT
ok....thanks for the response....I'll follow up and learn something