From c6a07f1ae2ef9041e069efbfe383b4566b169786 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 11 Apr 2024 16:00:29 +0200 Subject: [PATCH 1/2] Now really last commit for today --- book/_toc.yml | 1 - book/workflows/branches.md | 78 ++++++++++++++++++++++++++++++--- book/workflows/collaboration.md | 23 +++++----- book/workflows/edit_book.md | 6 +-- book/workflows/merge_request.md | 2 +- book/workflows/repositories.md | 65 --------------------------- 6 files changed, 86 insertions(+), 89 deletions(-) delete mode 100644 book/workflows/repositories.md diff --git a/book/_toc.yml b/book/_toc.yml index ed4468f..6991f20 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -17,7 +17,6 @@ parts: - file: workflows/collaboration sections: - file: workflows/milestones_issues - - file: workflows/repositories - file: workflows/branches - file: workflows/edit_book - file: workflows/check_changes_online diff --git a/book/workflows/branches.md b/book/workflows/branches.md index 874caf7..8c10211 100644 --- a/book/workflows/branches.md +++ b/book/workflows/branches.md @@ -9,12 +9,11 @@ This systematic workflow guarantees that editing the book goes smoothly. The act of making a new branch from an existing one is called *branching*. Usually, you want to branch from the `main` branch, but you can of course also choose to branch from another branch. The branch from which you create a new branch is called the *source* branch. -```````{tab-set} -``````{tab-item} User type 3 +`````````{tab-set} +````````{tab-item} User type 3 `````{tab-set} ````{tab-item} In GitLab - 1. On GitLab, navigate to the repository of your project. Under the project description, you should see a menu button with a "+" in it (see {numref}`new-branch-button`). Click this button, then click on "New branch". ```{figure} ../images/gitlab-branch.png @@ -40,17 +39,80 @@ The circled menu is the branch selection menu. ``` ```` ````{tab-item} In GitHub + ```{error} To be written ``` ```` ````` +```````` + +````````{tab-item} User type 4 and 5 + +```````{tab-set} +``````{tab-item} First time opening repository + +(cloning)= +## Find source in online repository + +`````{tab-set} +````{tab-item} From GitLab + +1. On GitLab, go to the repository of your book. Click on the blue button that says "Clone" ({numref}`gitlab-clone`), and copy the link under "Clone with SSH". + +```{figure} ../images/gitlab-clone.png +:name: gitlab-clone + +The cloning menu. +``` +```` + +````{tab-item} From GitHub + +```{error} To be written +``` + +```` + +````{tab-item} From GitHub using GitHub Desktop + +```{error} To be written +``` + +```` +````` + +## Open repository locally + +`````{tab-set} +````{tab-item} With Git in VS Code +2. Open a new VS Code window. You should be greeted with a welcome page ({numref}`vscode-welcome`). On this page, click "Clone Git Repository". Alternatively, open the Source Control menu from the left side bar, and click on "Clone Repository". + +```{figure} ../images/vscode-welcome.png +:name: vscode-welcome + +The VS Code welcome screen. +``` + +3. On the top of your screen, you should get a prompt asking you for a URL. In this field, paste the link you copied from GitLab and press enter. It will ask you to choose the location of the repository. After you've chosen a location, a final prompt will show up asking if you want to open the repository. Click on "Open". + +4. You now have a local copy of the repository. +```` + +````{tab-item} With GitHub Desktop +```{error} To be written +``` + +```` +````` + `````` -``````{tab-item} User type 4 and 5 +``````{tab-item} Using previously opened repository +(pulling)= ### Obtain newest version from online repository -If you're working on your local version of the repository, you've to make sure you're working on the most up-to-date version of your branch, pull changes from the remote repository on GitHub / GitLab into your local folder. +If you're working on your local version of the repository, you've to make sure you're working on the most up-to-date version of your branch. you can do so by `pull` changes from the remote repository on GitHub / GitLab into your local folder. `````{tab-set} ````{tab-item} With Git in VS Code @@ -65,7 +127,9 @@ If you're working on your local version of the repository, you've to make sure y ```` ````` +`````` +``````` ### Create your own version `````{tab-set} @@ -92,7 +156,7 @@ The branch selection menu, where our new branch has shown up. ``` ```` ````` -`````` -``````` +```````` +````````` Now that we've created and checked out our new branch, we can start {ref}`making and committing changes `. diff --git a/book/workflows/collaboration.md b/book/workflows/collaboration.md index f90cd3d..71c8cbb 100644 --- a/book/workflows/collaboration.md +++ b/book/workflows/collaboration.md @@ -11,31 +11,30 @@ We have previously introduced the notions of using Git in the online environment The steps involved are as follows: 1. Assign task to yourself - 2. Open the files of the repository online or locally - 3. Create your own version of the book - 4. Edit the book by: + 2. Create your own version of the book + 3. Edit the book by: `````{tab-set} ````{tab-item} User type 3 - Add or make changes to a file -- Share changes with others in Git-timeline +- Add changes to Git-timeline ```` ````{tab-item} User type 4 - Eventually solve issues with combining versions - Add or make changes to a file(s) -- Select files ready to be added to Git-Timeline -- Share changes with others in Git-timeline +- Select files ready to be added to Git-timeline +- Add changes to Git-timeline - Pushing your changes ```` ````{tab-item} User type 5 - Eventually solve issues with combining versions - Add or make changes to a file(s) -- Select files ready to be added to Git-Timeline +- Select files ready to be added to Git-timeline - Check changes in book locally -- Share changes with others in Git-timeline +- Add changes to Git-timeline - If working on a repository locally: pushing your changes ```` ````` - 5. Check changes online - 6. Repeat steps 4 and 5 until you're satisfied - 7. Reviewing, (eventually repeat steps 4 and 5) and combine your version with main draft version of book - 8. Publish changes to student version of the book \ No newline at end of file + 4. Check changes online + 5. Repeat steps 3 and 4 until you're satisfied + 6. Reviewing, (eventually repeat steps 3 and 4) and combine your version with main draft version of book + 7. Publish changes to student version of the book \ No newline at end of file diff --git a/book/workflows/edit_book.md b/book/workflows/edit_book.md index b27bfec..2897ffb 100644 --- a/book/workflows/edit_book.md +++ b/book/workflows/edit_book.md @@ -16,7 +16,7 @@ or add new file by text or upload ``````{tab-item} User type 4 and 5 ### Eventually solve issues with combining versions -First make sure you update your branch so that you've the most up-to-date version. If you collaborate on this branch, you get the updates from your colleagues as well. This might lead into a merge conflict. How to solve that? +If you collaborate with colleagues on this branch, you get the updates from your colleagues as well by pulling from GitLab/GitHub. Now your branch is up-to-date. However, this might lead into a merge conflict if you and colleagues have made incompatible changes. How to solve that? `````{tab-set} ````{tab-item} With Git in VS Code @@ -39,7 +39,7 @@ First make sure you update your branch so that you've the most up-to-date versio ``` Make some changes in for example VS Code and save them. -### Select files ready to be added to Git-Timeline +### Select files ready to be added to Git-timeline `````{tab-set} ````{tab-item} With Git in VS Code @@ -76,7 +76,7 @@ build book locally and eventually startup python server... `````` ``````` -## Share changes with others in Git-timeline +## Add changes to Git-timeline ```````{tab-set} ``````{tab-item} User type 3 diff --git a/book/workflows/merge_request.md b/book/workflows/merge_request.md index e88d82c..8854f40 100644 --- a/book/workflows/merge_request.md +++ b/book/workflows/merge_request.md @@ -6,7 +6,7 @@ Merging a branch into the main branch is also good moment to let a team-member r There is a slight difference in terminology between GitLab and GitHub. GitLab uses the term *Merge* Request while GitHub uses the term *Pull* Request. Both actions refer to the merging of a branch into the main branch. ``` -We're finished with our chapter, and now it's time to include all of our commits in the `main` branch. +We're finished with our chapter, and now it's time to include all of our commits in the `main` branch. However, it's good practise to first merge `main` into our branch, so that we can see if there are any merge conflicts. Assuming that those merge conflicts aren't there, we'll now continue this example with the following merge of our branch into `main`. `````{tab-set} ````{tab-item} In GitLab diff --git a/book/workflows/repositories.md b/book/workflows/repositories.md deleted file mode 100644 index b2b46ec..0000000 --- a/book/workflows/repositories.md +++ /dev/null @@ -1,65 +0,0 @@ -# Open files - -```````{tab-set} -``````{tab-item} User type 3 -Find your file on GitLab/GitHub ... -```{error} To be written -``` - -`````` - -``````{tab-item} User type 4 and 5 - -## Find source in online repository - -`````{tab-set} -````{tab-item} From GitLab - -1. On GitLab, go to the repository of your book. Click on the blue button that says "Clone" ({numref}`gitlab-clone`), and copy the link under "Clone with SSH". - -```{figure} ../images/gitlab-clone.png -:name: gitlab-clone - -The cloning menu. -``` -```` - -````{tab-item} From GitHub -```{error} To be written -``` - -```` - -````{tab-item} From GitHub using GitHub Desktop -```{error} To be written -``` - -```` -````` - -## Open the files locally - -`````{tab-set} -````{tab-item} With Git in VS Code -2. Open a new VS Code window. You should be greeted with a welcome page ({numref}`vscode-welcome`). On this page, click "Clone Git Repository". Alternatively, open the Source Control menu from the left side bar, and click on "Clone Repository". - -```{figure} ../images/vscode-welcome.png -:name: vscode-welcome - -The VS Code welcome screen. -``` - -3. On the top of your screen, you should get a prompt asking you for a URL. In this field, paste the link you copied from GitLab and press enter. It will ask you to choose the location of the repository. After you've chosen a location, a final prompt will show up asking if you want to open the repository. Click on "Open". - -4. You now have a local copy of the repository. -```` - -````{tab-item} With GitHub Desktop -```{error} To be written -``` - -```` -````` - -`````` -``````` From 93378a1270eba00cb8db9a2d1f7e08158288d6d2 Mon Sep 17 00:00:00 2001 From: Tom van Woudenberg Date: Thu, 11 Apr 2024 16:09:20 +0200 Subject: [PATCH 2/2] Now really last one --- book/workflows/collaboration.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/workflows/collaboration.md b/book/workflows/collaboration.md index 71c8cbb..752c881 100644 --- a/book/workflows/collaboration.md +++ b/book/workflows/collaboration.md @@ -22,16 +22,16 @@ The steps involved are as follows: - Eventually solve issues with combining versions - Add or make changes to a file(s) - Select files ready to be added to Git-timeline -- Add changes to Git-timeline -- Pushing your changes +- Add changes to Git-timeline locally +- Add changes to GitHub/GitLab ```` ````{tab-item} User type 5 - Eventually solve issues with combining versions - Add or make changes to a file(s) - Select files ready to be added to Git-timeline - Check changes in book locally -- Add changes to Git-timeline -- If working on a repository locally: pushing your changes +- Add changes to Git-timeline locally +- Add changes to GitHub/GitLab ```` ````` 4. Check changes online