Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Using GIT to get remote code

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not know from the online tutorial if I am properly establishing a connection with a git repository that is on a network.

All I have learned from a tutorial is how to set up a local repository, but getting data off of a network repository is knowledge I have yet to stumble upon or learn about and I wanted to save time by asking some online help forums.

I have just started using git after not using it for a while.
I have created a repository.
Then, as I was instructed, I made a “git clone” command which consisted of “git clone” followed by a path.
I expected this to get the contents of the path and put it into my repository – meaning the directory I made. This did not happen. What do I do?
How do I get a local copy of a remote work space for me to work on?

I am wondering if there is something like a "fetch" command I should be using.

The video tutorial I was looking at instructed how to make a local repository.  But if I am trying to get code from a network location, how do I go about making that happen?

I was instructed at my job to run this command (copied here in pseudo code)

git clone blah-blah:/blah/git/noogie/dork_monkey/

and when I did this grom git-bash it did not produce any errors which led me to think it was the command I needed to do.

But I did this from the local directory that I used

git init

to set up as a locak repository.

I assumed that typiing a "git clone..." command would have copied all of the files on the blah-blah server over.

But it did not.

I wonder if all this might have something to do with the fact that I need to get my network up and running first.

In my File File Explorer window, when I click on the "This PC" icon on the left, I can see I have five Network locationis mapped to drive letters.

But when I click on the Network icon I get an error.
 
Saloon Keeper
Posts: 26728
190
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you create a directory named "myproject", cd into it and type this command:


It will pull a copy of my Recipe Management webapp project from my git server (gogs.mousetech.com) and create a "GourmetJ" subdirectory.

That directory will contain all of the project source code and will be pre-initialized as a local git archive. You can, for example, cd int GourmetJ and do a "git status" command. You can even change source code and do "git commit"s on the project.

But that those changes will only live in the local repository inside that project directory. You'd need to do a "git push" (with proper authorization) to publish those changes back to my server for the world to see.

Note that the primary project git repositories are always part of their projects. If you have a local server, you can define one or more remote repositories for a git project. Since you pulled from my remore repository, you'd already have one defined:


You can add or remove others using the git remote command. Then you can pick one to be the target of your git push/pull operations.
 
Tim Holloway
Saloon Keeper
Posts: 26728
190
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I'm really not supposed to do that, but the spelling error in the title was bothering me, so I fixed it.
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic