Creating and Initializing Your Git Repo

Video
Software Tools
  1. Create a new folder for your project. Here is a suggested template folder structure to use. Add a few sentences to your README to describe the contents of the repository. For example, for this lab you might say something about holding code to verify that your FPGA and MCU are working properly.
/
├── fpga
│   ├── src
│   ├── sim
│   ├── radiant_project
│   ├── .gitignore
├── mcu
│   ├── src
│   ├── segger_project
│   ├── .gitignore
├── README.md
  1. Populate your .gitignore files. This file tells git which files and folders should not be tracked. It’s best practice to ignore many of the miscellaneous configuration files that Radiant and SEGGER Embedded Studio generate. Sample .gitignore files are included below. Paste the contents of these files into the .gitignore files you created.

Sample Radiant .gitignore

# Lattice Radiant files
*.html
impl*/
*.xml
.build_status
.run_manager.ini
.recovery
.spread_sheet.ini
.spreadsheet_view.ini
*.dir/
*.log
*.tcl
*.ccl
*.srp
*.dmp
._Real_._Math_.vhd

Sample SEGGER Embedded Studio .gitignore

# Segger Embedded Studio
**/Output/
**/Debug/
*.emSession
*.jlink
  1. Initialize your git repository using git init.
  2. Add the existing files in your folder using git add .. (Note: the . means to add all the contents of the current directory, so you’ll need to make sure you’re at the root).
  3. Make an initial commit with the folder structure above by typing git commit -m "Initializing Lab 1 repository".
  4. Open the Github web interface and create a new repository on Github (link). Name your repository something descriptive like e155-lab1. Optionally add a short description.
  5. Link your local git repository to the new remote repository by adding a new remote. This will look something like git remote set-url origin git@github.com:<username>/<repo>.git where you’ll need to replace <username> and <repo> with your specific information. For my example, this command is `git remote set-url origin git@github.com:joshbrake/e155-lab1.git
  6. Push your local commit to the remote using git push origin main. If git complains that it doesn’t know what main is, then your branch might be named master. In this case, run git branch -m master main and run the push command again.
  7. Navigate to your repository page on Github and you should see your folder structure there.

Here’s a video walking through the steps above as well.

Share Your Feedback

NoteShare Your Feedback!

If you caught any typos or have any suggestions for this page, please open an issue on the website Github repository. Click the link here for instructions on how to create an issue.