Want to quickly share some source codes or a project with the developer community? Free cloud repositories (e.g., GitHub, BitBucket etc.) are the possible alternatives. Obviously, you can use one of these repositories from the very beginning of your project; however, until you are ready to share, you may keep the repository private or don’t commit to the cloud. For instance, GitHub uses Git as the underlying version control system and supports unlimited public repositories for free. A comprehensive tutorial on that can be found here.
Following simple steps just show how to quickly share an existing project codes on GitHub:
- Create a free account on GitHub.
- Create a repository for the project you want to share.
- It’s a good practice to include a readme file and a license file.
- Note down the https clone URL of the repository.
- On your local system, make sure that Git for windows or equivalent software for your platform is installed.
- Designate a local directory where you want to keep all your local repositories (e.g., C:\GitRepos).
- Launch Git Bash from this directory. On window Git Bash appears in the context menu.
- From Git Bash type the following command which will create a new directory for the repository with a local copy of the repository: git clone [clone URL obtained earlier].
- From Git Bash navigate inside the repository directory: cd [repository directory]
- From windows explorer copy all your project files inside the repository directory.
- From Git Bash type the following command which will add all file to the staging area of the local repository: git add .
- From Git Bash type the following command which will commit the changes to the local repository: git commit –m “check-in comment”
- From Git Bash type the following command which will publish or push the local changes to the public repository: git push -u origin master
- You are done!