How can I use Git locally?

theonlygusti picture theonlygusti · Sep 4, 2015 · Viewed 42.3k times · Source

I'm working on a project at the moment, which I'd like to eventually make public on github, but, for the moment, needs to remain private.

Github needs users to pay in order to host a private repository, which I'm unwilling to do, so just creating a private github repository is not an option for me.

However, I would still like to use git for version tracking etc. whilst I'm working on the project locally, so that when I do eventually put the project on github, all of this information, the project's changes start-to-finish, will be available.

But, I have no clue how to use git without a remote server. I'm wondering now if it just exactly the same, simply without the need for git push.

The perfect answer for me would be a step-by-step walkthrough, telling me exactly what I should type into the terminal to set up and maintain a local git repository.

Answer

jfadich picture jfadich · Sep 4, 2015

A remote server is never required. You can just do git init in your project. If you decide to add a remote server later, it will maintain all the history when you push it.

Also if you want you can use Bitbucket or GitLab. Both of them allow private repositories for free.