How to - git fork
Prerequisites
You should be able to log in to your account on CoCo GitLab. You can find instructions on how to set it up with SSH here.
What is Git Fork?
When you create a fork of a repository, it is copied and can be developed as its own project, independent of the original. A fork can also be merged back into the original repository. So the fork of the repository is also like a fork in the road when a project wants to go in two different directions.
In contrast to the Git branch, the fork is a completely new repository where you can do everything without affecting the original repository.
How do I fork a repository?
-
Go to the GitLab page of the repository you want to fork and click on the Fork button next to the title on the right-hand side of the screen.
It will look something like this:
-
A page with settings opens.
Here you can change the name, namespace, slug, description and visibility according to your preferences and permissions. If you are satisfied with the settings, click on the Fork project button.
infoIf there are several options to choose from in the namespace selection, you can use your CampusId if in doubt.
-
Wait until the process is completed:
-
If you see the message The project was successfully forked., you have done it and are now on the page of your fork.
How to clone a forked repository?
-
Click on the blue clone button and then copy the address from the window that opens.
-
Now you can clone the project using a shell (GitBash/Terminal).
IntelliJ
-
Directly on the start screen of IntelliJ, if no project is open, click on the "Get from VCS" button at the top right.
-
On the next screen, select "Git" under "Version Control" and copy the link from GitLab into the "URL" field. In the "Directory" field, you can determine the folder on your computer the project should be saved. If you click on the small folder symbol on the far right of the column, you can also select it via the Explorer or Finder. Clicking on the "Clone" button at the bottom right clones and opens the project.
Terminal/GitBash
-
Start the terminal and navigate to the folder where you want to save the project on your computer.
-
Type
git clone
, before you press enter, paste the link from GitLab. It should look like this:
git clone git@git.coco.study:ebollen/guides.git
- If you now press the "Enter" key, the project is cloned. You then only have to navigate to the folder with a
cd <insert_your_repo_name_here>
.
There is also a guide that deals with cloning in more detail: How To - git clone
-