Create New Crate
Patterned on: New Repo Creation
Notes 🔗
- These instructions assume github with ssh key auth but any would be similar
- If creating a egui application with eframe I have an opinionated setup with a script at https://github.com/c-git/my_egui_template (See readme for more details).
Instructions 🔗
-
Create empty repo in cloud
-
Create folder on local machine with same name (same name is recommended not required)
-
Open a command prompt in the folder and initialize the crate
cargo init --lib
-
Make initial commit
-
Add remote repo connection (Can be copied from github)
git remote add origin git@github.com:wykies/REPO_NAME.git
-
Push branch to remote (Can be done from vscode UI) and set current branch as a tracking branch (-u sets current brach to tracking)
git push -u origin main
-
Copy in and link to template (for updates). To see more explanation of these steps see CI instructions.
git remote add template git@github.com:c-git/rust-crate-template.git git fetch template git merge --allow-unrelated template/main
-
Resolve merge conflict
git checkout template/main -- .gitignore git checkout template/main -- Cargo.toml git checkout template/main -- src/lib.rs
-
Restore crate name (was lost during merge).
-
Add CI.