Upload Code
- Clone the repository from git:
git clone git@github.com:diku-dk/libRAINBOW.git
- Use the GUI guide
- Create a local branch:
git branch <issue_number>b
git checkout <issue_number>b
Where the issue number would be **, see GUI. - Insert you code by
- By making a folder in isl
cd python/isl mkdir < your code name >
- Enter your folder
cd < your code name >
- The copy all your code into here
- By making a folder in isl
- Adding test
- In isl, find test
cd .. cd test
- creat a test folder
mkdir test_< your code name >
- Enter your test folder and make a test file
cd test_< your code name > touch test_< your code name>.py
- Copy paste this template into you test folder
import unittest import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + "/../../") import isl.my_folder.my.api as api class TestMyAPI(unittest.TestCase): def test_generate_unique_name_1(self): expected = [...] actual = [...] self.assertNotEqual(actual, expected)
- In isl, find test
- Make pull request:
git push --set-upstream origin <issue_number>b
- Use the GUI guide for the rest
Squeeze commits
This tutorial assumes that you work on your private branch. In other words, you are not allowed to squeeze commits.
- Checkout your branch
git checkout < your branch >
- Assume you want to squeeze 3 commits:
git log
- The type
git rebase -i HEAD~3
-
To squeeze commit 2 and 3, type f in front of them
- Check that it worked using git log
Update your branch
Let’s say that your branch is out of sync. Then you want to update it.
- First checkout your branch
git checkout < your branch >
- The rebase with main. Be prepared for merge conflicts
git rebase main