Submissions
by Tomas Trescakยท Setup

Root Folder
Not Attempted
NameProgress
Introduction
Not Read
๐Ÿฐ Player
Not Read
Software Installation
Project Setup
Running and Testing
React and ReactDOM
๐Ÿ’ก Assignment 1: Welcome Message
Not Attempted
Submissions
React
Not Attempted
NameProgress
JSX and Components
Not Read
Props
Not Read
๐Ÿ‘พ Exercise: Props
Not Attempted
CSS Styles
Not Read
useState and Hooks
Not Read
๐Ÿ‘พ Exercise: useState
Not Attempted
Conditional Rendering
Not Read
Lists
Not Read
๐Ÿ‘พ Exercise: Lists
Not Attempted
Forms and Events
Not Read
๐Ÿ‘พ Exercise: Forms
Not Attempted
๐Ÿ’ก Assignment 2: Front End
Not Attempted
Advanced React
Not Attempted
NameProgress
Pure Components - memo
Not Read
Lifecycle - useEffect
Not Read
Expensive? - useMemo
Not Read
DOM Interactions - useRef
Not Read
forwardRef
Not Read
useImperativeHandle
Not Read
๐Ÿ‘พ useImperativeHandle
Not Attempted
Context
Not Read
useCallback
Not Read
useId
Not Read
useReducer
Not Read
Infrastructure
Not Attempted
NameProgress
Database
Not Read
NextAuth and Github Authentication
Not Read
Prisma and ORM
Not Read
Project Setup
Not Read
Project Authentication
Not Read
APIs
Not Attempted
NameProgress
APIs
Not Read
APIs - Slides
Not Attempted
Rest APIs
Not Read
Rest APIs - Express.js
Not Read
ReastAPIs - Next.js
Not Read
Securing APIs
Not Read
Securing APIs - NextAuth
Not Read
tRPC
Not Attempted
NameProgress
tRPC
Not Read
tRPC - Routers
Not Read
tRPC - Server Rendering
Not Read
tRPC - Client Rendering
Not Read
Persisting Data
Not Read
Assignment 3: APIs
Not Read
0 / 250 XP

Lecture Transcript
If you prefer text to video, check out the transcript of the presentation above

In this section, we dip our toes into version control using Git and Github. We also show you how to submit your assignment and check the submission on SkillPies.

To submit your assignment, you need to stage and commit it to your repository and then push it to Github.

In Git, the term "staging" relates to grouping your changed files based on the functionality you are working on. For example, changing the look of the button, or changing the calculation of the tax formula.

Once the files are in the stage, you commit them to your repository, creating a named point in time which records all the changes to your files up until that point. These changes can be viewed for posterity or even rolled back.

Last, you can share your changes with the rest of the team by pusing it to a remote repository.

The repository then notifies your project members that can pull the changes to their computers. Understanding the difference between these three actions is crucial for effective version control and collaboration in Git. Let's take a look at an example!

Let's talk about how you can safely create different versions of your files. Imagine that you currently have six files in your project.

You changed the first five files while working on your project. But your changes relate to two things you worked on.

For example, the first change would relate to login functionality

and the other changed the look of your task list. Therefore, you would like to separate those two changes into two distinct commits.

This is where the staging area becomes essential. You can choose to stage-specific files or even individual parts of files, which gives you greater control over your commits. For instance, start by staging the first three files.

Staging is also useful for tracking changes in your files. When youโ€™re satisfied with a particular change and want to experiment further, you can store the file in the staging area. This allows you to easily compare any future modifications against the version youโ€™ve staged.

Once you are happy with all your changes and you staged all the files, you can commit them to your repository. This creates a new record, which can be reviewed or rolled back in case you change your mind in the future.

Let's commit to the repository the second set of changes.

First, we stage them.

Then, we create a new commit. We did not mention that each commit must be accompanied by a message briefly describing the purpose of the committed changes. This time, we say that we added a Google login. Let's take a look now at how we can share our changes with the rest of the project team.

Until now, we only worked on our computer with local files. This reflects the distributive nature of Git, where every developer has a complete copy of the repository, making the process secure and almost foolproof.

But, when we want to share our files, we must use a remote, shared repository. In our case, we use Github as our repository provider. Other providers, such as Gitlab, exist, and you can even host your repository server, but for now, Github will do.

To share our files with the rest of the team, we need to push the changes to Github. This will copy all the commits we have made locally to the remote repository.

The rest of the team, or anyone who has access to the repository can pull the changes to their computer, to obtain the newest version of source files.

For example, if commit 3 and commit 4 appear in the repository,

we can pull these changes to our local computer and work with the project's latest version.

To store your changes in the repository, you need to add changed files to the stage, selecting them and clicking on the plus icon. Then, we need to add a commit message summarising the list of our changes. Clicking on the commit button saves the changes to the local repository. Then, you can Sync, or Push and Pull changes to and from the remote repository.

Once you submit your files, Github Classroom will run automated checks to see if your solution is correct. There are multiple ways you can check if your solution passed all the tests.

The easiest way is to run "pnpm test" in Visual Studio Code and make sure that all tests turn green.

You can also check out test results in SkillPies. First, make sure you specified your Github user name in your bio on your profile page.

Then, you can just refresh the assignment page, and on the top you will see one of the three possible messages. First, the yellow message tell you that you have not yet pushed any of your changes to the remote repository and the system did not run any tests.

The red message tells you that at a least one of the tests failed and you must re-visit your solution.

The green message is a thumbs up that your solution is correct and you can continue with the next exercise.

You can also visit your repository on Github and see the test log there! First, you have to log in to Github and find the assessment repository. Then, in the "Actions" tab, you will see all the test runs that Github performed. Find the one that interests you and explore the log. This is actually a CI pipeline which we will talk about later in this course. With this assignment you are officially no longer a rookie and let's start doing some real React work!

Description
All the extra information about this section

Submitting the assignment means to "commit" and  โ€œpushโ€ your changes to the repository on github. 

In Git, the terms "committing" and "pushing" refer to two distinct stages in managing and sharing changes within a repository. Understanding the difference between these two actions is crucial for effective version control and collaboration in Git.

Git Workflow

Committing Files

Committing is the process of saving your changes to the local repository. When you make changes to files, Git tracks these modifications. To commit is to record the current state of the files in your local Git database. This action creates a "commit," which is like a snapshot of your repository at a specific moment in time. Each commit is accompanied by a commit message, which is a brief description of what changes were made and why. This allows you and others to understand the history of changes when reviewing the project's development.

Benefits of Committing:

  • History and Rollback: Each commit has a unique ID, allowing you to keep a detailed history of changes. If a mistake is made, you can easily revert to previous versions.

  • Incremental Changes: Committing frequently keeps your work incremental, making it easier to isolate and fix bugs.

  • Documentation: Commit messages serve as documentation for the changes made, which is helpful for both current collaborators and future maintainers.

Pushing Files

Pushing refers to the act of sending your committed changes from your local repository to a remote repository. This remote repository is typically hosted on a server or a service like GitHub, GitLab, or Bitbucket. Pushing makes your changes available to others and often follows several local commits that collectively make up a complete piece of work or a fix.

Benefits of Pushing:

  • Collaboration: Pushing changes to a remote repository shares your work with team members. Others can pull your changes from the remote to their local environments to continue collaborative work.

  • Backup: By pushing to a remote repository, you create a backup of your work that is stored independently from your local machine. This protects your work against local hardware failures.

  • Continuous Integration: In environments with continuous integration/continuous deployment (CI/CD), pushing changes can trigger automated tests and deployment processes, helping to maintain code quality and streamline the deployment process.

The primary difference between committing and pushing in Git is the scope of action. Committing is local, affecting only your repository and allowing you to save and document your changes without affecting others. Pushing is a network action that updates the remote repository and is essential for collaborative projects. Together, these actions form the backbone of Git's distributed version control capabilities, allowing for robust management of project changes across different environments and teams.

Submitting in Visual Studio Code and Codespaces

To commit your files, open the Source Control menu by clicking on the button in your left menu. It should have a little number โ€œ1โ€ next to it, showing you the list of the changes that you made:

Source Control

Please fill out your commit message and click on the big โ€œCommitโ€ button. The files should now disappear. Once that is done,  you can either click the โ€œSync Changesโ€ button that replaced the โ€œCommitโ€ button or please click on the โ€œโ€ฆโ€ menu and select โ€œPushโ€

Pushing Code

There is also a sync button at the bottom of your editor that you can use to push and pull changes from the repository

Sync

 

Maggie

Discuss with Maggie
Use the power of generative AI to interact with course content

Discussion

1 comment
Loading editor ...
Remember to be polite and report any undesirable behaviour

Category

Empty

Labels

Discussion has no labels

1 participant

user avatar

Priority

Notifications

You're not receiving notifications from this thread.
Course Outline