gitgithubrustrust-cargo

How do I change a dependency and track changes to my GitHub project?


I'm making changes to a GitHub repo I cloned to my machine. I also need to make changes to the code of one of its dependencies (listed as solana-vote-interface = "2.2.3" in Cargo.toml under [workspace.dependencies]).

When I change the source of the dependency (located in /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana-vote-interface-2.2.3/src/state/mod.rs), VS Code doesn't track the changes or let me commit them. I understand this is expected as I'm changing code outside of the repo I cloned. How I should I go about making sure these changes are tracked so I can commit them along with changes I make to the cloned repo itself?


Solution

  • Fork the dependency, integrate it as a Git submodule, update your main project's Cargo.toml to use the local path, and commit changes in both repositories.