Creating a Git Repository and adding a collaborator
If you want to share your projects and code, or collaborate with other programmers and colleagues, using Git is a must. This guide shows you the first thing you'll most likely do when beginning to use GitHub - creating an account, a repository, and uploading some files for sharing.
What does Git (the source control software) offer you? Most importantly - control over the history of your development - branch out to create features separately, merge them together, commit changes or revert to previous versions of your application. Storing your projects on the cloud with GitHub allows you to work on them from different devices, and allows teams to collaborate seamlessly even from different continents.
Let's begin with the basics!1. Creating a GitHub Account
- Go to GitHub.
- Click Sign up (top-right).
- Enter a username, email, and password, then follow the setup steps.
- Verify your email and complete the account setup.
2. Creating a New Repository
Before going forward, let's clarify a bit - what exactly is a repository? Well, it's a storage space for your project's files and history. It contains:
- Files: All the files of your project - code, documents, images, and other assets.
- Version History: Through commits, allows you to move up and down through your project's history and changes.
- Branches: Different version of your projects (you commit changes to a branch), allowing you to work on different features without having them interfere. The default branch is called main
- Collaboration Tools: Allows multiple developers to work on a project together - A project can be public, allowing anyone to see its files. In this way, anyone can develop new features and ask for them to be added to the main project through pull requests. A project may also be private, only its' added collaborators being able to see the project files and update them.
Every project should have its own repository. So let's create one for ourselves.
- Log in to GitHub.
- Click the + icon (top-right) → New repository.
- Enter a repository name (e.g.,
cursuri-web
). -
Choose Public or Private:
- Public: Anyone can see your repository.
- Private: Only you and invited collaborators can access it
- (Optional) Add a README file - this should contain information about your project.
- Click Create repository.
3. Uploading Files via GitHub Web
- Open your repository on GitHub.
- Click Add file → Upload files.
- Drag and drop files or click choose your files to select from your computer.
- (Optional) Add a commit message (e.g., "New functionality added - account creation and deletion.").
- Click Commit changes to upload.
4. Adding a Collaborator (For Private Repositories)
- Go to your repository on GitHub.
- Click Settings (top-right).
- Go to Collaborators under "Manage access".
- Click Add people and enter their GitHub username.
- Send the invite and wait for them to accept.
And that's it! Still, this is just the very basics of Git, but it should be enough to get you started. Why don't you upload your first coding project to github and show it off to the world?