1

I'm trying to learn GitHub, so I downloaded the necessary tools including SourceTree. The purpose is for learning only. But I ran into a stumbing block when it comes to creating a remote repository. Can I create one on the same machine as the local repository. It looks like I have to pay to use one on the GitHub server. But how do I set this up so that I can learn it locally on my machine?

Ray
  • 4,679
  • 10
  • 46
  • 92

3 Answers3

3

Note that you can always host a "remote" repository on your local machine that your "local" repository (on the same machine) can treat as origin. Simply go to c:\somedirectory and type git init --bare. Then go to c:\someotherdirectory and type git clone c:\somedirectory .. Then when you push and pull from the latter directory, it will be to/from the repo in the former directory.

David Deutsch
  • 17,443
  • 4
  • 47
  • 54
  • +1 this is the way to go if you are playing around. once you clone it doesn't matter where the remote is. – Mircea Feb 01 '16 at 23:14
0

You can create a public repository on Github for free. Just create an account and follow https://help.github.com/articles/creating-a-new-repository/

Then you can clone the remote repository to a folder on your local machine using SourceTree.

If you already have a local git repository, you can simply set its remote path to your newly created Github repository using top right Settings button in SourceTree, then you can push changes to the remote Github repository.

Roy Wang
  • 11,112
  • 2
  • 21
  • 42
0

Github team has a GitHub Overview Training video series that may be helpful to you https://www.youtube.com/playlist?list=PLg7s6cbtAD15Das5LK9mXt_g59DLWxKUe

You can create an open source repo on github for free, and then you can clone that repo down to your local, or if you already have an existing local repo you can do hook it up and push your local project to your github repo by doing the following

$ git remote add origin https://github.com/your-repo-link
$ git push -u origin master

By the way, Github has their own GUI tools https://desktop.github.com/ which I'd recommend over SourceTree.

Ray
  • 12,101
  • 27
  • 95
  • 137