|
Assignments files for lecture "Algorithms and Datastructure" 2014
|
|
Assignments files for lecture "Algorithms and Datastructure" 2014
|
|
================================================
|
|
=================================================================
|
|
|
|
|
|
You can use this repository as "upstream" to your workspace to simplify the setup for each assignment.
|
|
You can use this repository as "upstream" to your workspace to simplify the setup for each assignment.
|
|
|
|
|
|
* Start Eclipse and open the Git perspective: Window -> Open Perspective -> Other... -> Git Repository Exploring
|
|
1) Start Eclipse
|
|
* Then click on he icon that says "Clone a Git Repository and add the clone to this view"
|
|
----------------
|
|
* set URI to `git@forge.tic.eia-fr.ch:sup-algorithms/tp-algo1-2014.git`
|
|
* Start Eclipse.
|
|
* Accept the default and click on "Next >"
|
|
|
|
* The system might ask for the passphrase.
|
|
|
|
* The "master" branch should be selected. Click on "Next >"
|
|
|
|
* Set the field Directory where you want to save the repository.
|
|
|
|
* The default remote name is "origin". change it to "upstream" and clinc on "Finish"
|
|
|
|
|
|
|
|
* Now you can open the Java perspective
|
|
2) Generate a SSH key pair (optional)
|
|
|
|
-------------------------------------
|
|
|
|
Note: You can skip this step if you already have a SSH key pair or if you prefer to use the HTTPS protocol.
|
|
|
|
|
|
File -> New -> Java Project
|
|
* Open the "Preferences" menu of Eclipse and navigate to `General -> Network Connections -> SSH2`
|
|
Uncheck "use default location", click on Browse and choose the directory (.../git/tp-algo1-2014/s01) of your local git repository
|
|
* Choose the "Key Management" tab.
|
|
click on "Finish"
|
|
* Generate a key RSA key.
|
|
|
|
* Copy your public key as a new key in [gitlab -> My profile -> SSH Keys](https://forge.tic.eia-fr.ch/git/keys)
|
|
|
|
* Protect your private key with a good passphrase and save it.
|
|
|
|
|
|
|
|
3) Clone the upstream repository
|
|
|
|
--------------------------------
|
|
|
|
* Open the "Git perspective": `Window -> Open Perspective -> Other... -> Git Repository Exploring`.
|
|
|
|
* A new "git" icon should appear in the upper right corner of your window.
|
|
|
|
* Click on he icon that says "Clone a Git Repository and add the clone to this view".
|
|
|
|
* Set URI to `https://forge.tic.eia-fr.ch/git/sup-algorithms/tp-algo1-2014.git` if you use HTTPS or `git@forge.tic.eia-fr.ch:sup-algorithms/tp-algo1-2014.git` if you use SSH with a private/public key.
|
|
|
|
* Accept the defaults valurs and click on "Next >".
|
|
|
|
* The system might ask for the passphrase. If so, give the passphrase that you used to protect your private key.
|
|
|
|
* The "master" branch should be selected. Click on "Next >".
|
|
|
|
* Set the field "Directory" with the path where you want to save the repository.
|
|
|
|
* The default remote name is "origin". change it to "upstream" and click on "Finish".
|
|
|
|
|
|
right-click on "Remotes" and choose "Create Remote..."
|
|
4) Create your own remote repository
|
|
choose Remote name: origin
|
|
------------------------------------
|
|
Leave the selection on "Configure push" and click "OK"
|
|
* Point your browser to [the forge](https://forge.tic.eia-fr.ch/git/])
|
|
|
|
* Choose the tab "Projects"
|
|
|
|
* Click on "+ New Project"
|
|
|
|
* Name your project "tp-algo1-2014" in your own name space
|
|
|
|
* Click on "Create project"
|
|
|
|
* Copy the URI of your project (it should be `https://forge.tic.eia-fr.ch/git/user.name/tp-algo1-2014.git` if you use HTTPS and `git@forge.tic.eia-fr.ch:user.name/tp-algo1-2014.git` if you use SSH)
|
|
|
|
|
|
set the URI to the URI of your reository
|
|
5) Add the teacher and the assistant as reporter to your repository
|
|
(git@forge.tic.eia-fr.ch:jacques.supcik/tp-algo1-2014.git)
|
|
-------------------------------------------------------------------
|
|
|
|
* Select your prohect and navigate to `Settings -> Project Members`
|
|
|
|
* Add the teacher and assistant as a "Reporter"
|
|
|
|
* If you work in a team, you can also add your co-worker as a "Developer"
|
|
|
|
|
|
click on "Save and Push"
|
|
5) Add your remore repository to Eclipse
|
|
|
|
----------------------------------------
|
|
|
|
* Go back to Eclipse, and right-click on "Remotes".
|
|
|
|
* Choose "Create Remote...".
|
|
|
|
* Set the "Remote name" to `origin`.
|
|
|
|
* Leave the selection on "Configure push" and click "OK".
|
|
|
|
* Set the URI to the one of your repository
|
|
|
|
(`https://forge.tic.eia-fr.ch/git/sup-algorithms/tp-algo1-2014.git` or `git@forge.tic.eia-fr.ch:user.name/tp-algo1-2014.git`).
|
|
|
|
* Click on "Save and Push".
|
|
|
|
* Right-click on "origin" and choose "Configure Fetch...".
|
|
|
|
* Click "Advanced...".
|
|
|
|
* Click "Add All Branches Spec".
|
|
|
|
* Click "Finish".
|
|
|
|
* Click "Save".
|
|
|
|
|
|
right-click on "origin" and choose "Configure Fetch..."
|
|
Now "origin" iy **your** repository where you save your work and
|
|
click "Advanced..."
|
|
"upstream" is the **teacher's repository** where we save the initial files for the assignemnts.
|
|
click "Add All Branches Spec"
|
|
|
|
|
|
|
|
Click "Finish"
|
|
6) Set the origin as your default remote repository
|
|
Click "Save"
|
|
---------------------------------------------------
|
|
|
|
* Right-click on the repository name (tp-algo1-2014)
|
|
|
|
* Click on "Properties"
|
|
|
|
* Click on `branch -> master -> remote`
|
|
|
|
* Replace "upstream" by "origin"
|
|
|
|
|
|
now "origin" iy *your* repository where you save your work
|
|
7) Create your first Java project for this lecture
|
|
"upstream" is the teacher's repository where he save the initial files
|
|
--------------------------------------------------
|
|
|
|
* Open the "Java perspective".
|
|
|
|
* Create a new Java project `File -> New -> Java Project`.
|
|
|
|
* Uncheck "use default location".
|
|
|
|
* Click on Browse and choose the directory of your local git repository (.../git/tp-algo1-2014/s01).
|
|
|
|
* Click on "Finish"
|
|
|
|
|
|
Before each new assignment, fetch from the "upstream" repository
|
|
8) Add the "git" menu to your Java perspective
|
|
|
|
----------------------------------------------
|
|
|
|
* Click on `Window -> Customize Perspective...`.
|
|
|
|
* Open the "Command Groups Availability".
|
|
|
|
* Check "Git" and "Git Navigation Action"
|
|
|
|
|
|
|
|
9) Solve the assigment
|
|
|
|
----------------------
|
|
|
|
* Edit the files to solve the assignment and save your file
|
|
|
|
* Commit often your changes to your local repository (using the "Commit changes" icon of your menu bar)
|
|
|
|
* Push your changes to the "origin"
|
|
|
|
|
|
|
|
10) At the beginning of each new assignment, fetch the "upstream"
|
|
|
|
----------------------------------------------------------------
|
|
|
|
* Open the "Git perspective": `Window -> Open Perspective -> Other... -> Git Repository Exploring`.
|
|
|
|
* Open the "Remotes" section of the repository "tp-algo1-2014"
|
|
|
|
* Right-Click on "upstream" and choose "Fetch"
|
|
|
|
|
|
|
|
11) Create the new project and solve the next assignment
|
|
|
|
--------------------------------------------------------
|
|
|
|
* Open the "Java perspective".
|
|
|
|
* Create a new Java project: `File -> New -> Java Project`.
|
|
|
|
* Uncheck "use default location".
|
|
|
|
* Click on Browse and choose the directory of your local git repository (.../git/tp-algo1-2014/s0x).
|
|
|
|
* Click on "Finish".
|
|
|
|
* Edit the files to solve the assignment and save your file.
|
|
|
|
* Commit often your changes to your local repository.
|
|
|
|
* Push your changes to the "origin".
|
|
|
|
|