2

I use Netbeans on 2 computers. I would like to use git to keep the same source code for my project on the 2 computers. I tried this way :

On first computer (192.168.0.1) :

  1. Select a project on Netbeans > Team > Git > Initialize
  2. Add all the files, Commit
  3. On terminal, wrote the following command to create a bare repository :

git clone --bare myproject myproject.git

cd myproject.git mv hooks/post-update.sample hooks/post-update

git update-server-info

On second computer (192.168.0.2) :

  1. Launch Netbeans > Team > Git > Clone
  2. Enter my repository URL : 192.168.0.1/myproject.git
  3. Selected Master branche, Parent Directory, etc.
  4. It worked ! All my project from the First computer on the Second computer.

Now, I would like to push the modification from the first computer to the second computer. I tried this way :

On first computer (192.168.0.1) :

  1. On netbeans, modify an file, then Team > Git > Commit
  2. Team > Git > Remote > Push, then Repository URL is : file:///Users/me/projects/myproject.git/

On second computer (192.168.0.2) :

  1. Team > Git > Remote > Pull
  2. Repository Location is pre-filled : origin:192.168.0.1/myproject.git/
  3. Select the master branche.
  4. Nothing happens. The modifications don't appear.

Where did I made a mistake ?

I actually want to use the workflow displayed here : Git with 2 developers

Community
  • 1
  • 1
lepix
  • 4,992
  • 6
  • 40
  • 53
  • 3
    The link "Git with 2 developers" describes how you set up a public bare repository to mimic a centralized workflow. If you are the only one working on the project, why not just stay with one repo, and clone it with git clone file://////? Or keep the repo in a dropbox folder or something? – ebaxt Feb 25 '12 at 19:55
  • Actually, with netbeans, when I clone a git project, it create a new netbeans project. So if I just want to work with one repo, I will have to : 1) On PC1, create my repo, modify files 2) On PC2, create the clone from PC1. Create new netbeans projecT. Modify file. 3) On PC2, recreate a repo, back to PC1, recreate netbeans project from the clone of PC2... ? Or maybe I'm really missing something :( – lepix Feb 26 '12 at 00:36
  • Not sure I understand what the problem is. Are you referring to the IDE project files (meta-data) that you need to create twice? If so, just add everything to the git repo, and on PC2 after you have cloned the repo from PC1, choose the "open existing project" option you probably have in Netbeans. If Netbeans creates a new project when you clone, you can clone from the command line, and then just load the same project files from PC1? – ebaxt Feb 26 '12 at 05:27

1 Answers1

0

There is a bug in the Git Plugin of this version of Netbeans : it is not possible to connect to a remote repository which is in the local network.

-> http://netbeans.org/bugzilla/show_bug.cgi?id=205963

lepix
  • 4,992
  • 6
  • 40
  • 53