Does anyone have good step by step directions for creating a repository in VSCode for the first time and another set of directions for setting up a program using an existing repository. We aren’t allowed to meet in person for the first three weeks and need some help with this!
If you are looking for software to make the instructions, Windows 10 has a built-in program called Steps Recorder that you can use for it. When ever you click it takes a screenshot with your mouse highlighted and I think you can export to PDF.
Read your post again and realized that this is not what you asked for. This is probably what you are looking for
GitHub desktop is also a very good option for beginners.
Have you looked at Git Version Control Introduction — FIRST Robotics Competition documentation (wpilib.org)? It could be clearer, but it’s a start.
An important point is that, as explained on page linked above, you need to install Git independently from VS Code as VS Code includes a Git UI that requires Git to be present.
Also be aware that you will need to set the user name and user email before you can push anything back to the repository from VS Code. One way to do so it via:
git config --global user.name “Your Name”
git config --global user.email “[email protected]”
(where Your Name should be your GitHub login and [email protected] the email you used to register on GitHub)
You may also find that short video helpful: Version control in Visual Studio Code
Thanks, I have used GitHub for years but I still find it frustrating to teach students how to use it.
Creating a New Robot Project and Repo
-
Create the new project in VS code. Save in a reasonable location (I keep a folder on Desktop labeled Repos).
-
Download Git on your computer.
-
Open the GitBash terminal
-
Navigate to the location of your project folder. In GitBash, use commands cd to change your directory. In my case, I would use:
cd Desktop/Repos/[NameOfMyProject]
-
Use git init to initialize a new repo
git init
-
Use git add * to add all files to the repository.
git add *
-
Commit these changes:
git commit -m "Create Robot Project"
-
Create a new repo on github to house the remote repo
-
Use the following commands to push the repo to the remote. You may be asked to log in with a personal access token. Learn about them here
git remote add origin [url of your github repo]
git branch -M main
git push -u origin main
Cloning a Repo for Others to Use
-
Navigate to github and make sure the new user has access to the repo
-
Copy the url of the repository
-
Use GitBash to navigate to an appropriate folder you wish to place the repository. Again, I’ll assume it’s a folder on the Desktop called Repos:
cd Desktop/Repos
-
Use git clone to clone the repo
git clone [repo URL]
-
Open the file from VSCode
Other Resources:
Git Cheat Sheet - Educational Edition
Git Cheat Sheet - Atlassian
Let me know if you need clarification on any of the above or if you need further instructions on adding, commiting, pushing, pulling, or using branches.
This is great, my student was able to set up our code on GitHub easily. Thanks!
If you’re teaching github to others frequently, I highly suggest reading the below book. Keep a copy around for reference. It’s worth the ~$20 dollars on amazon. (Cheaper versions are found here used, but I’ve never used thrifty books before.)
Also, read this article How to Write a Git Commit Message and make a shorten 7-10 page power point on it. It’s very beneficial as well.
Once you have the basics down, for greater understanding of how git actually works under the hood (especially as you get into merges, rebases, branches, etc), I’ve found this tutorial really insightful. Git Internals - Learn by Building Your Own Git
Another resource is the free Pro Git book, written by Scott Chacon and Ben Straub available at Git - Book (git-scm.com)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.