Skip to content
Snippets Groups Projects
README.md 3.22 KiB
Newer Older
Juho Pekki's avatar
Juho Pekki committed
# Instructions
Juho Pekki's avatar
Juho Pekki committed

Juho Pekki's avatar
Juho Pekki committed
## Common

A student forks this project and pushes script programming assignments in it before given deadline following the instructions below.

----

# How to work with the project

In order to use git fluently, it's highly recommended to use Git from the command line.  
Depending on your operating system, use one of the following commands in order to install git:  

```console
Windows: download exe behind the following link: https://git-scm.com/
Linux/Debian distro: sudo apt install git
Mac/Homebrew: brew install git
```  

Of course you can use your browser and "click and pick" approach but the following instructions focuses on using the git in a "advanced" way.  

----

## How to fork the project

At first, a student has to fork this project to himself at *gitlab.labranet.jamk.fi server* (make a new copy of the original project).  
This happens using a *fork* button at the top right corner and selecting namespace for a project. Namespace defines a location where new project will be created.  

:small_orange_diamond: Click the original project's fork button and select the namespace where you want to fork it<br/>
:small_orange_diamond: After forking is complite, navigate to the location and make sure that it was successful<br/>

![#f03c15](https://placehold.it/15/f03c15/000000?text=+) **Remember to change project visibility to private so others can't see your answers and add maintainer priviledges to the teacher!** ![#f03c15](https://placehold.it/15/f03c15/000000?text=+)

----

## How to clone the project

in order to use the project workspace in your local computer you have clone the project in it. You can think this step as a copying and linking the project from the server to your local computer. 

:small_orange_diamond: Open your browser and copy the url of your project (for example: https://gitlab.labranet.jamk.fi/juhpek/example)<br/>
:small_orange_diamond: Start your command line tool and navigate to the folder where you'd like to clone the project and use the following command:``git clone your-project-url``<br/>
:small_orange_diamond: After the command above has been entered, you have to enter your JAMK Labranet credentials<br/>

----

## How to push changes

A final step of this tutorial is to know how to push new versions to the gitlab.labranet.jamk server.  
This includes commiting and pushing a.k.a making local changes and forwarding these to the server.   

:small_orange_diamond: Start your commandline tool and navigate to the cloned repository (root folder of the local git project)<br/>
:small_orange_diamond: Add new local changes in project's git tracking file using a add command: ``git add .`` <br/>
:small_orange_diamond: Add new commit message and commit new changes by using a following command: ``git commit -m "message in here"`` <br/>
:small_orange_diamond: Push new changes to the gitlab.labranet.jamk.fi server using the following command: ``git push``<br/>
:small_orange_diamond: Finally enter your Labranet credentials

----

## Postscript

By following these instructions you have a one clean project that includes all the assignments you have done.  
This style allows you to do assignments where ever you are. Always remember to push new local changes to the project in gitlab.labranet.jamk.fi server.