Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • R3/school/courses
  • vilem.ded/courses
  • todor.kondic/courses
  • noua.toukourou/courses
  • nene.barry/courses
  • laurent.heirendt/courses
  • marina.popleteeva/courses
  • jenny.tran/courses
8 results
Show changes
Commits on Source (3)
Showing
with 56 additions and 30 deletions
# Add repository to workspace (separately from cloning)
# Add an already locally existing repository to workspace
![bulb](slides/img/bulb.png) If you already have a copy of repository on your laptop, you can add it to VS code by following:
![bulb](slides/img/bulb.png) If you already have downloaded a repository, you can add it to VS code by following:
- Go to **File > Add Folder to Workspace**
......
# Create new branch
# Create a new branch
To encapsulate your changes, isolate your work from other and help Git to easile merge virsions later, we work on branches.
As part of the workflow, create a branch before starting to work.
- Click on branch symbol in side bat (bottom of VS Code window)<br>
<img height="100px" src="slides/img/branch.png">
- Choose "+ Create New Branch..."<br>
<img height="230px" src="slides/img/newBranch.png">
- Give the name to your new branch<br>
<img height="100px" src="slides/img/newBranchSwitched.png">
\ No newline at end of file
- Click on branch symbol (bottom left)
<img height="100px" src="slides/img/branch.png">
- Choose "+ Create New Branch from..."
- Give the name to your new branch
- Select `origin/develop`
<img src="slides/img/icon-live-demo.png" height="100px">
# Make changes and commit them
When you change file/s VS Code with remind you of unsaved changes (left image) and saved by not commited changes (right image):<br>
<img height="230px" src="slides/img/UnsavedChanges.png">
<img height="230px" src="slides/img/SavedButUncommitedChanges.png">
When you change a file, save them by clicking on `File > Save` or by hitting a shortcut (`CTRL + S` or `Command + S`).
![bulb](slides/img/bulb.png) On the left side, observe the git icon.
<br>
To commit your changes:
1. Go to Source Control in Activity Bar
2. Stage all changes you want to commit (press +)
3. Describe your changes in commit message
4. Commit your changes (press "tick")
<img height="230px" src="slides/img/commit.png">
\ No newline at end of file
<img src="slides/img/icon-live-demo.png" height="100px">
\ No newline at end of file
2022/2022-06-07_git-trilogy-part-2/slides/img/UnsavedChanges.png

117 KiB

2022/2022-06-07_git-trilogy-part-2/slides/img/commit.png

110 KiB

2022/2022-06-07_git-trilogy-part-2/slides/img/newBranch.png

124 KiB

2022/2022-06-07_git-trilogy-part-2/slides/img/publish.png

90.2 KiB | W: 0px | H: 0px

2022/2022-06-07_git-trilogy-part-2/slides/img/publish.png

25.6 KiB | W: 0px | H: 0px

2022/2022-06-07_git-trilogy-part-2/slides/img/publish.png
2022/2022-06-07_git-trilogy-part-2/slides/img/publish.png
2022/2022-06-07_git-trilogy-part-2/slides/img/publish.png
2022/2022-06-07_git-trilogy-part-2/slides/img/publish.png
  • 2-up
  • Swipe
  • Onion skin
2022/2022-06-07_git-trilogy-part-2/slides/img/push.png

44.8 KiB | W: | H:

2022/2022-06-07_git-trilogy-part-2/slides/img/push.png

39.4 KiB | W: | H:

2022/2022-06-07_git-trilogy-part-2/slides/img/push.png
2022/2022-06-07_git-trilogy-part-2/slides/img/push.png
2022/2022-06-07_git-trilogy-part-2/slides/img/push.png
2022/2022-06-07_git-trilogy-part-2/slides/img/push.png
  • 2-up
  • Swipe
  • Onion skin
# Merge your changes to original repository - via **Merge Request**
# Merge your changes to original repository via **Merge Request**
Now your cahnges are in your fork on the server. You want to incorporate it into original repository. Create **Merge Request**.<br>
- If you just published branch, simply click "Create merge request"<br>
<img height="230px" src="slides/img/mergePublishedBranch.png"><br>
- If worked sometime, go to Repository > Branches and click "Merge request"<br>
<img height="330px" src="slides/img/mergeRepoBranches.png">
Now your changes are in your fork on the server.
If you want to incorporate your work into original (upstream) repository, submit a **Merge Request** via the Gitlab interface.
- If you just published branch, click "Create merge request"
# Merge Request
- Make sure you are merging *new* branch in **your fork** to *develop* branch in **original repository**<br>
<center>
<img width="30%" src="slides/img/mergePublishedBranch.png">
</center>
- If the button does not show up, go to `Repository > Branches` and click on `Merge request` for the branch you want to merge.
<center>
<img width="50%" src="slides/img/mergeRepoBranches.png">
</center>
# Merge your changes to original repository via **Merge Request**
- Make sure you are merging the *new* branch from **your fork** to the *develop* branch in **original repository**
<center>
<img height="130px" src="slides/img/MRwrong.png">
<img height="130px" src="slides/img/MRright.png">
- Give meaninfull title (start with "Draft:" if you are planning to continue work on this feature).
- Ticke "Delete source branch when merge request is accepted." if finished work on this feature.
- Crosscheck:<br>
<img height="430px" src="slides/img/mergeCheck.png">
\ No newline at end of file
</center>
- Give a meaningful title (start with "Draft:" if you are planning to continue work on this feature).
- Tick `Delete source branch when merge request is accepted.`
<center>
<img height="430px" src="slides/img/mergeCheck.png">
</center>
\ No newline at end of file
# Save your changes to server - push them
Your changes are saved localy. You need to save them on server. In git words: you need to *push them into your fork*.
Your changes are saved and committed locally.
If you chreated branch localy, it does not exest on the server. You need to *publish branch* first:
You need to save them on server. In git jargon: you need to *push them into your fork*.
2 scenarios:
- If you created branch locally, it does not exist yet on the server. You need to click on `Publish Branch` first:
<img height="230px" src="slides/img/publish.png">
For all future changes or when the branch was created online:
For all future changes or when the branch already existed, click on `Sync changes`:
<img height="330px" src="slides/img/push.png">
\ No newline at end of file
......@@ -5,4 +5,3 @@
Contact us if you need help:
<a href="mailto:lcsb-r3@uni.lu">lcsb-r3@uni.lu</a>