Search code examples
gitgithubsourcetree

How do I use remote repositories in GitHub when I'm just learning it?


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?


Solution

  • 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.