Chapter 3. Git & GitHub Project Setup

Three Cases in Git & GitHub Project Setup

Three Cases in Git & GitHub Project Setup
Tag:

Typically, there are three cases to launch a Git project depending on who initiates it and becomes the owner of the Remote Repository. Depending on your role in the project, the approaches to the Git & GitHub project setup differ. Before we explain how to set up a project for each case, we'll briefly explain what the three cases are.

Case 1. Project initiator (owner)

If you want to initiate a Git project yourself, you need to create a Local Repository on your local computer with the git init command. Then, you can develop code and commit it to keep recording the code version history using Git. Once the code is ready to share with others, you can create a Remote Repository on the GitHub platform and transfer the code to it. After you give your project member (collaborator) access to the repository, your project member can get the code from the repository.

Case 2. Project member (collaborator)

If you join a project as a project member (called collaborator in the GitHub terminology), you don't need to create a Git Local Repository by the git init command. Once you get access to the Remote Repository from the repository owner, you can create a copy of the project code on your local computer by running the git clone command. When you clone the code, a Local Repository is also created on your local computer, and the code and commit history are stored in the repository.

Case 3. Non-project member

Even though you are not a member of the project (not designated as a project collaborator), if the Remote Repository is publically available, you can create a replica of the project code and you can start a project using the code. The action to create a replica of an existing repository called Fork. In this case, you'll become the owner of the forked repository.

Typically, there are three cases to launch a Git project depending on who initiates it and becomes the owner of the Remote Repository. Depending on your role in the project, the approaches to the Git & GitHub project setup differ. Before we explain how to set up a project for each case, we'll briefly explain what the three cases are.

Case 1. Project initiator (owner)

If you want to initiate a Git project yourself, you need to create a Local Repository on your local computer with the git init command. Then, you can develop code and commit it to keep recording the code version history using Git. Once the code is ready to share with others, you can create a Remote Repository on the GitHub platform and transfer the code to it. After you give your project member (collaborator) access to the repository, your project member can get the code from the repository.

Case 2. Project member (collaborator)

If you join a project as a project member (called collaborator in the GitHub terminology), you don't need to create a Git Local Repository by the git init command. Once you get access to the Remote Repository from the repository owner, you can create a copy of the project code on your local computer by running the git clone command. When you clone the code, a Local Repository is also created on your local computer, and the code and commit history are stored in the repository.

Case 3. Non-project member

Even though you are not a member of the project (not designated as a project collaborator), if the Remote Repository is publically available, you can create a replica of the project code and you can start a project using the code. The action to create a replica of an existing repository called Fork. In this case, you'll become the owner of the forked repository.

Tag: