Congratulations on creating your Markdown profile!
Now, let's use Git to push it to our Wiki directory.
Git is a version control system that helps track changes in your files and collaborate with others on projects.
It is often used by companies but also on software teams to keep track of changes.
It also keeps track of who made which changes.
At Serpentine we use GitLab, which adds a few features atop of basic git.
We will show you all of this in this guide where you will contribute to our wiki with you own personal spin!
Before we start we need to make sure you have a GitLab account and git intalled.
git:
To check if you have git installed, open a terminal.
In this terminal run the following command.
git --version
It should output something like this:
$ git --version
git version 2.41.0
If an error like "command not found" or "file not found" occurs, please check how to install git.
GitLab:
If you are able to login you are all set. If not, please ask someone from the ICT committee for help.
Cloning means creating a copy of the remote repository (the one hosted online) on your local computer.
When you do this you also copy the git information.
With the git information you can see who changed what.
You can then freely edit the directory on your computer without changing the online files.
We are now going to clone the wiki.
git clone git@gitlab.serpentine.ai:ict/vps/wiki.js.git
You now have the entire wiki on your computer, you can explore the files.
A branch is like a separate workspace for making changes without affecting the main project.
You can easily create a branch using the git checkout
command
git checkout -b add-<name>-profile
When you now run
git branch
The output should look something like this
$ git branch
* add-john-profile
main
We are going to add your profile to the wiki-rewrite/members/ directory.
profile.md
file from the markdown guide.profile.md
into the wiki directory, under the members directory.profile.md
to the format initials_surname.md
.j_slang.md
git status
You should see that your file is present, but it's not staged.
Staging means you're telling git what changes you're going to apply.
Committing means actually saving your changes with a description.
git status
againgit add <your file here>
.j_slang.md
you'd run.git add members/j_slang.md
git commit -m "Add a Markdown profile for <name>"
Make sure to change with your name.
With this you have now told git to save your changes to the git structure locally.
We now need to upload this to the gitlab server remotely.
Pushing means sending your local changes to the remote repository so others can see and work on them.
git push origin add-<name>-profile
This will now push the changes to a new branch on the wiki.
You should be able to see it on GitLab by going here.
However, the changes are not automatically added to the wiki.
For that you your changes need to be merged with the main branch.
To do this we're going to make a pull request.
A pull request is a way to suggest your changes to the main project. Others can review, comment, and decide whether to include your changes.
You should be able to see your branch on the GitLab page.
Go to the merge request tab.
Follow the steps. (IMAGES ARE NEEDED. WILL TAKE MORE TIME)
Write a short descriptive title and some description about what changes you've made.
For this request it doesn't have to be complicated.
This is normally how these changes happen on other projects as well.
GitHub projects also follow these steps for pushing these changes.
With the merge request your part is done.
Your request will now be reviewed by the project maintainers, and you will be kept up to date via email.
Your team members will review your changes. If everything looks good, they will merge your changes into the main branch.
Congratulations! Your Markdown profile is now part of the Wiki. You can access it online from the members Wiki page.
Remember to keep your local repository up-to-date by pulling changes from the remote repository regularly.
That's it! You've successfully pushed your Markdown profile to the Wiki directory using Git. This detailed guide should help you contribute your content effectively to your project's documentation. Happy documenting