In database terminology primary key refers to the column in a table that's intended to be the primary way of identifying rows. Each table must have exactly one, and it needs to be unique. This is usually some kind of a unique identifier associated with objects presented by the table, or if such an identifier doesn't exist simply a running ID number (which is incremented automatically).
Follow the next steps to init your project in your own Gitlab or Github account. You must create just one repository per group. Rest of the team members must be given access to this repo.
Configure GIT¶
- Download and install GIT in your own computer: https://git-scm.com/downloads.
- Open a command prompt or shell.
Git Bash
(bash style command prompt available after you install GIT is a good option). cd
to the directory where you want to create your repository- Configure GIT global attributes:
git config --global user.name "insert here your name"
git config --global user.email "insert here your email address"
git config --global color.ui auto
git config --list
Fork the repository¶
- Open the URL of course project either in GitLab or Github
- Press the fork button at the top of the page and follow instructions
- Change the name of the project.
- In GitLab go to
Settings>General>Project name
- In Github go to
Settings>Repository name
- Add permission for team members
- In GitLab go to
Members>Invite Members
. Role to be able to push data should be at least Developer - In Github go to
Settings>Manage Access>Invite Teams or People
. Role to be able to push data should be at least Write. - Add permission to course staff: enkwolf and ivanmilara (GitLab only!)
Clone the repo in your local computer¶
Clone
the project in your computer. Clone URL appears at the top right corner.- If you want to use login and password for
pulling
andpushing
use the HTTPS option - If you want to use a private key use the SSH option. You can follow instructions on how to setup a private key in Gitlab or how to setup a private key in Github.
Modify your code in local computer and push to the server¶
- Synchronize your remote server:
git pull origin main
- Edit your files
- Check the status of your files
git status
- Add the files you want to include in the commit to the stage area:
git add my-file
- If you want to include all modified files
git add --all
- Check the status of your files
git status
- Create the commit:
git commit -m "message"
- Check the status of your files
git status
- Repeat 2 - 7
- Syncrhonize your changes in the remote server:
git push origin main
Create the wiki¶
Documentation must be written in your project Wiki. However, when you fork the repository the Wiki is not copied. Wiki is created in an additional repository. The original Wikis are:
- In Gitlab: https://gitlab.com/programmable-web-project-/pwp-/wikis/home
- In Github: https://github.com/programmable-web-project-unioulu/PWP/wiki
You have two options to copy the wiki in your own project.
OPTION 1: Not that much experience with GIT
What we need to do is to clone the wiki that we provide in your own computer and then move the content of this wiki to the wiki on your own Gitlab/Github project.
What we need to do is to clone the wiki that we provide in your own computer and then move the content of this wiki to the wiki on your own Gitlab/Github project.
- Create a new folder in your computer, for instance name it
project-template
. Clone the Wiki template provided by the course staff inoriginalproject
. URLs for cloning can be found in the following links: - In Github:https://github.com/programmable-web-project-unioulu/PWP/wiki
- In Gitlab: https://gitlab.com/programmable-web-project-/pwp-/wikis/home
- Create a new folder anywhere in your file system. For instance name it
myproject
- Clone in
myproject
the Wiki of your personal GIT project (should be currently empty). The URL is either in the Clone this wiki locally (Github) or Clone repository (Gitlab). - Copy all the content from
project-template
intomyproject
. Do not move the hidden .git folder - Using the Git bash
cd
tomyproject
. - Execute the following GIT commands:
git add --all
git commit -m "Initial Commit"
git push origin main
You can now edit your Project Work Report either using the Web interface or using your local computer and pushing the changes.
OPTION 2: Some experience with Git
This option allows you synchronize with the course Wiki in case we need to do some changes during the course.
- Create a new folder for your Wiki. For instance, name it
myproject
. - Clone in this folder the Wiki of your personal GIT project (It should be empty right now). The URL is either in the Clone this wiki locally (Github) or Clone repository (Gitlab).
- Create a new remote. You must use the URL of the course template wiki provided by the course staff. After that do a
pull
to that remote in order to copy the Project Work Report. Solve any conflicts that appear, usually in thehome.md
file. After thatcommit
all changes and do apush
to your own project's wiki repo. Following commands will perform these tasks. - In Gitlab:
git remote add pwp-template https://gitlab.com/programmable-web-project-/pwp-.wiki.git
git remote -v
git pull --allow-unrelated-histories pwp-template main
git rm -f Home.md
git add --all
git commit -m "Initial commit"
git push origin main
- In Github:
git remote add pwp-template https://github.com/programmable-web-project-unioulu/PWP.wiki.git
git remote -v
git pull --allow-unrelated-histories pwp-template main
git rm -f Home.md
git add --all
git commit -m "Initial commit"
git push origin main
OPTION 3: Alternative way: Mirroring a repository
In this case, we are mirroring the old repository following this tutorial.
In this case, we are mirroring the old repository following this tutorial.
- Create a bare clone of the template repository. A bare repository does not allow to access the files. You just download the repo database.
git clone --bare https://github.com/programmable-web-project-unioulu/PWP.wiki.git
- Push by mirroring the repository to your own wiki version
cd PWP.wiki.git
git push --mirror <<URL TO YOUR WIKI REPO>>
- Remove the repo that you have created
cd ..
rm -rf PWP.wiki.git
Now you should see in your Github project the wiki. Next, you need to clone the repo in your own machine.
git clone <<URL TO YOUR WIKI REPO>>
Modify the wiki in local computer and push to the server¶
- Synchronize your remote server:
git pull origin main
- Edit your files
- If you want to include images or other files to your wiki, they must go in a folder named
uploads
- Check the status of your files
git status
- Add the files you want to include in the commit to the stage area:
git add my-file
- If you want to include all modified files
git add --all
- Check the status of your files
git status
- Create the commit:
git commit -m "message"
- Check the status of your files
git status
- Repeat 2 - 8
- Syncrhonize your changes in the remote server:
git push origin main