Topic: [Fixed] Am I setting up this GIT repo correctly?

Hi all,

This is my maiden attempt in using git - and I am trying to model it according to the client server model, wherein there are multiple developers, pushing and pulling from a common git repo kept on a remote server - say xyz.com

This is how I am doing it...

On xyz.com, inside the codebase dir, initialize a git repo
- git init
- git add .
- git commit -m "Initial import"


Then on my local dev machine
- git clone git@xyz.com:/path/to/git/repo
- .....make changes....
- git add .
- git commit -m "my changes"
- git push


PROBLEM
Now at this stage, when I clone this git repo again from xyz server, I do get the latest code.
However, if on xyz.com, from inside the /path/to/git/repo directory, I run "git status", it shows me uncommited changes.

git@xyz.com:/path/to/git/repo$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   chrome/content/.file.js~
#
git@xyz.com:/path/to/git/repo$


This is the same file I deleted from my local machine using "git rm -f chrome/content/.file~"

Is this correct?
My best guess is, I'm missing something here.

Please let me know if I need to provide more info about this scenario for the problem to make sense.

Thanks in anticipation...

Oh, BTW - Git rocks!
I soo am loving just _one_ .git directory as compared to multiple .svn directories smile)


--
Maku
http://makuchaku.in

Last edited by makuchaku (2009-09-08 08:22:41)

-------------------------
http://adomado.com

Re: [Fixed] Am I setting up this GIT repo correctly?

hmm, have you added the following to .git/config on your local machine?

[branch "master"]
  remote = origin
  merge = refs/heads/master

if not, try putting it right at the bottom after everything else.

- thanks to John Nunemaker for that tip: http://railstips.org/2008/11/24/gitn-yo … ed-host-on

I've just read your blog post on setting up a git repo (on what I'm presupposing is your own website) and understand your reasons for not starting out with a bare git directory, but I wonder if that might be causing some problems.... 

If it's at all possible, it might be worth trying from scratch with Redmine added to the git-ignore file AND starting out with a bare repo on the server.  Once you have your code on the server, just remove Redmine from .git-ignore and then add -> commit -> push

hopefully some of this will help you out

Re: [Fixed] Am I setting up this GIT repo correctly?

When setting up Redmine projects, it specifically looks for .git directory. And when creating a --bare git repo, the .git directory isn't created.

But thats all ok, even setting up regular git repos work for me.

Thanks for your suggestion :)

--
Maku
http://makuchaku.in

-------------------------
http://adomado.com

Re: [Fixed] Am I setting up this GIT repo correctly?

Solution available at http://www.makuchaku.in/blog/how-to-set … -branching

-------------------------
http://adomado.com