Creating and Initializing Your Git Repo
Video
Software Tools
- 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- 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
- Initialize your git repository using
git init. - 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). - Make an initial commit with the folder structure above by typing
git commit -m "Initializing Lab 1 repository". - 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. - 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>.gitwhere 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 - 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, rungit branch -m master mainand run the push command again. - 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.