We use Visual Studio Code with the Remote - Containers extension. This lets you use a Docker container as a full-featured development environment. A devcontainer.json file in Core tells VS Code how to access (or create) a development container with a well-defined tool and runtime stack.
To get started try the following:
- Install Visual Studio Code
- Install Docker Desktop
- Start Docker Desktop
- PC users: Windows limits resources to WSL 2 (Memory/CPU), this limit can be configured in your .wslconfig file.
- Start VS Code and add Dev Containers Extension
- Run
Dev-Containers: Clone Repository in Container Volume...
from the Command Palette (F1). - Pick GitHub (You'll need to authenticate with GitHub), then enter
JesusFilm/react-prep
, finally choose themain
branch to clone. - The VS Code window (instance) will reload, clone the source code, and start building the dev container. A progress notification provides status updates.
- After the build completes, VS Code will automatically connect to the container. You can now work with the repository source code in this independent environment as you would if you had cloned the code locally.
Common Issues
docker-compose version --short
fork/exec /usr/local/bin/docker-compose-v1: bad CPU type in executable
- Open Docker Desktop
- Go to Settings -> General, and scroll down to the bottom
- Tick 'Use Docker Compose V2'
- Click 'Apply & Restart'
- Go to VS code and run 'Rebuild Container'. The container should now build successfully
- Open Docker Desktop
- Go to settings -> Resources -> Advanced
- Set CPUs: 7, Memory: 12.00GB, Swap: 4GB
- Click 'Apply & Restart'
Why is version control important?
- Creating your own branch.
-
Create a new branch by clicking on the current branch name, click
+ Create new branch...
and enter the name of your new branch as[user-name]-main
You will be using this as your main branch, and it is where you will be pushing your changes to.
branches are what allows us to all work collaboratively
- Making your first commit.
-
Create another new branch and call it
complete-first-task
-
Tick off the first task from the main readme by making the following change
- [x] 1. [Initial Set Up](/1-SetUp/README.md)
-
Stage the change by going to
Source Control
and pressing the+
next to the file you changed -
Enter a commit message and press
Commit
buttonA good commit message is meaningful and concise. It's what others will use to see what you have done as well as to remind yourself of your work
-
Push the commit to remote. (It might ask you to publish the branch first, just click ok if it does)
-
Create a new pull request (PR) on github
-
Select your branch from the list of branches (you get to it by clicking on the button similar to the one below), and click
Create Pull Request
-
Make sure to select your main branch as the base branch. (
[user-name]-main
) -
Click
Create Pull Request
Depending on the teams your on, you may be required to fill in a description as well as the list on the right
-
-
Review and merge
Have a look at the
Commits
tab and theFiles changed
tab, these are what your reviewers will be looking at when working apart of a project
Note: You can push changes straight to your main branch and don't have to raise a PR to make a change. But most projects you'll be apart of will require you to.