Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Why dont changes reflect in actual repository files?(When i clone from server i see the changes but not when viewing file)
icon5.gif  Why dont changes reflect in actual repository files? [message #731981] Mon, 03 October 2011 11:29 Go to next message
Gersh  is currently offline Gersh
Messages: 2
Registered: October 2011
Junior Member
So here is the issue: Say i have a git repository home/porject.git/ with a file sample.html which contains the word "hello world", when i clone it with egit onto my machine and change sample.html to "bye world" i could push to live and all works.
When i clone it onto another machine the file will show "bye world" but the live file home/porject.git/sample.html on the server will still show "hello world". Confused
I know it is saved in the objects, but how do i make the actual original file home/porject.git/sample.html change when i push live?

Re: Why dont changes reflect in actual repository files? [message #732016 is a reply to message #731981] Mon, 03 October 2011 13:13 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin Rosenberg
Messages: 317
Registered: July 2009
Senior Member
Gersh skrev 2011-10-03 17.29:
> So here is the issue: Say i have a git repository home/porject.git/ with
> a file sample.html which contains the word "hello world", when i clone
> it with egit onto my machine and change sample.html to "bye world" i
> could push to live and all works.
> When i clone it onto another machine the file will show "bye world" but
> the live file home/porject.git/sample.html on the server will still show
> "hello world". :? I know it is saved in the objects, but how do i make
> the actual original file home/porject.git/sample.html change when i push
> live?

Server repos should be "bare" repos, i.e without a working tree. It has
been considered bad practice to have a checkout on the server. You can
search the Git Mailing lists for extended discussions on the topic.

You could have a hook on the server that updates the working tree there,
if you really want it. By default git forbids pushing to a non-bare
repository if you try to push to the currently checked-out branch.
Pushing to other branches is fine.

-- robin
Re: Why dont changes reflect in actual repository files? [message #732020 is a reply to message #732016] Mon, 03 October 2011 13:40 Go to previous messageGo to next message
Gersh  is currently offline Gersh
Messages: 2
Registered: October 2011
Junior Member
Hey Robin,
Thanks for taking to time to respond it is very much appreciated.

I tried applying a similar solution using this method: toroid.org/ams/git-website-howto (copy paste i cant post links yet)
However he says to run the commands below on the local machine which i have no idea how to do with egit:
$ git remote add web ssh://server.example.org/home/ams/website.git
$ git push web +master:refs/heads/maste
Re: Why dont changes reflect in actual repository files? [message #734848 is a reply to message #732020] Mon, 10 October 2011 03:33 Go to previous message
Matthias Sohn is currently offline Matthias Sohn
Messages: 548
Registered: July 2009
Senior Member
Gersh wrote on Mon, 03 October 2011 13:40
Hey Robin,
Thanks for taking to time to respond it is very much appreciated.

I tried applying a similar solution using this method: toroid.org/ams/git-website-howto (copy paste i cant post links yet)
However he says to run the commands below on the local machine which i have no idea how to do with egit:
$ git remote add web ssh://server.example.org/home/ams/website.git
$ git push web +master:refs/heads/maste


See [1], add a remote called "web" then do "Configure Push" in order to define how to map your local branches to branches in the remote repository.

[1] http://wiki.eclipse.org/EGit/User_Guide#Adding_a_Remote_Configuration
Previous Topic:Make egit 'Checkout' match egit 'Switch to'
Next Topic:Identify Changed Files
Goto Forum:
  


Current Time: Fri Aug 01 04:00:32 EDT 2014

Powered by FUDForum. Page generated in 0.17488 seconds