- create a new rust project by
cargo new
cargo new hello
cd hello
- init project
git add .
git commit -m "init"
-
create repository on github
-
push this repository to github
git remote add origin git@github.com:zyyang90/hello.git
git branch -M main
git push -u origin main
- run with
cargo run
cargo run
-
add
Cargo.lock
to .gitignore -
push first commit
git add .
git commit -m "first commit"
git push origin main
- use
cargo new
to create a new Rust project - create repository on github, and push codes to github
- use
cargo run
to run the project: hello - Cargo.lock is generate by
cargo
, which should add to .gitignore