-
Notifications
You must be signed in to change notification settings - Fork 2
Home
For Windows users, you should look for "Terminal" or "Windows Powershell" in your computer.
1. pwd
Stands for "Print Working Directory". This prints which folder you're at.
When you first open Terminal and type pwd, it will return:
C:\Users\<username>
2. ls
Stands for "List files". Prints all the folders you're able to access given the folder you're in currently.
In this case, my computer is returning all the folders and files under the C:\Users\linhe directory.
3. cd
Stands for "Change Directory". You can use this to access other directories.
For example: I can use cd IRIS_PCB to access that specific folder. Notice how I am in a different directory now.

Suppose I want to go back to the previous directory, I can use cd ..

Special case: If you're folder name contains spaces, you will use back slashes around the file to prevent any errors. For example, if your file is called "My File", then you should use cd .\My File\.
4. clear
Stands for... clear. This clears everything on your terminal so it doesn't look messy.
For Windows 10, you should use cls to clear terminal instead.
5. history
Use this to look up past commands you've used. This may or may not be useful for you.
There are a lot more commands. For more information, please refer to the link below.
For Windows users: https://www.freecodecamp.org/news/command-line-commands-cli-tutorial/
1. pwd
Stands for "Print Working Directory". This prints which folder you're at.
When you first open Terminal and type pwd, it will return:
/Users/<username>
2. ls
Stands for "List files". Prints all the folders you're able to access given the folder you're in currently.
In this case, my computer is returning all the folders and files under the /Users/henrylin directory.
3. cd
Stands for "Change Directory". You can use this to access other directories.
For example: I can use cd IRIS_PCB to access that specific folder. See how I am in a different directory now.
Suppose I want to go back to the previous directory, I can use cd ..
Special case: If you're folder name contains spaces, you will add a backslash in front of the space to prevent the terminal from returning a bug.
4. clear
Stands for... clear. This clears everything on your terminal so it doesn't look messy.
5. history
Use this to look up past commands you've used. This may or may not be useful for you.
Again, there are a lot more commands. For more information, please refer to the link below.
Mac Terminal Guide: https://www.taniarascia.com/how-to-use-the-command-line-for-apple-macos-and-linux/
(Tutorial taken from ECE120/220 Documents)
Step 1: Download the latest version of Git. Link: https://git-scm.com/downloads
Once it is downloaded, click on it to install. (For settings, just use the recommended ones for everything.)
Step 2: To verify that you've successfully installed git, I would type git --version on terminal. This should return the version of Git you have. If no errors are shown, git has been successfully installed.
Step 3: Setup Github username and email
Use:
git config --global user.name "<username>"
git config --global user.email <your_email>
With < username > and < your_email > replaced with your Github username and email.
If you've done the above steps, you have successfuly setup Github on your device. If you ran into any problems, feel free to let us know.
To clone the repository, you will need to open on terminal, go to the directory you want to files to be stored in, and type:
git clone https://github.com/IllinoisRoboticsInSpace/IRIS_PCB.git
Then, you should have all the files downloaded. Use cd IRIS_PCB to enter the folder.
This is where you should work on your KiCad projects. Next, we will look at how you should properly push these files onto Github.
Step 1: PULL BEFORE PUSH!!!
The first thing you want to do, and the most important thing of all, is git pull.
Since we are a 20-people team, many people are constantly pushing new files into our repositories. Therefore, if you do not pull before push, you might overwrite other's work. It is also good practice to pull before push.
Step 2: Go to the correct branch
Next, you want to make sure you are at the correct branch.
If this is a new project, there might not be a branch on Github. To create a new branch, use git branch <branch_name> to setup a new branch. Next, push the new branch onto Github using git push -u origin <branch_name>. With that, you can continue pushing your files onto Github.
You can use git branch -a to see which branch you are in.
The asterik (*) indicates the branch I am in.
If you're not in the correct branch, use git checkout <branch_name> to move to other branches.
Keep in mind that you should never try to push onto the main branch. Only the team leads have permission to edit the main branch. This is to prevent individual project teams from editing the same files and also to hide the main branch from all the unfinished projects.
Here is a brief idea of Github branches. The master branch is our main branch, and you can add as many branches as we like.

Once your team is done with the project, you will make a "Pull Request" to the main branch to merge the two branches. Refer to Part 4 for more information.
For more information on Git Branches, feel free to refer to https://www.youtube.com/watch?v=QV0kVNvkMxc&ab_channel=NetNinja
Step 3: Stage your files
There are three steps to pushing your file onto Github. They are: stage, commit, and push.
We can use git status to check any modified, added, or removed files.
Next, we can use git add <filename> to stage these files.
If youe ever made a mistake, you can use git restore --staged <filename> to unstage the files.
Once you have the files added, you can type git status again to make sure they are staged.
Notice how the staged files would turn from red to green. This is how you can make sure the files are staged.
Step 4: Commit
Next, you will commit the files.
git commit -m "<Some_comments>"
Remember to write something short but meaningful for the comments. For example, instead of writing "update", you could write "update resistor values".
Step 5: Push
Finally, you can push it onto Github. You can do this by using git push.
You should always check the github repository to make sure the changes have been pushed.
If your project team has finished your design for the PCB, you should make a pull request to merge your branch into main. To do this, go into the repository on github.com.
Click on Pull Requests > New Pull Request.
In here, you should select the branch you are pulling from (Usually your project branch), and the the branch it should merge into (Usually the main branch).
Next, click on Create Pull Request. For the comments, you would normally have to explain what you've done, but it's not necessary for our purposes. (I will haunt you down to explain the circuits anyway :))
Finally, click on Create Pull Request.
That's it! You've completed your project!