This PR adds the changes made in #39 to the main branch:
This PR adds the command git update -r URLtoRemoteRepo -m CommitMsg, where the -r and -m parameters are optional. This command is simply a convenience function that automatically performs a sequence of git operations to set the state of the git repo to the current state of the local arc folder. The command follows the following logic:
Iterate over all files in the repo and stage them either with git add or git lfs track based on a currently fixed size limit
Stage all removed files via git add -u
Perform a commit with the message passed via -m which defaults to "Update"
If -r URLtoRemoteRepo is present then perform remote remove origin; remote add origin URLtoRemoteRepo
If remote origin is defined then perform git pull --rebase origin master
If remote origin is defined then Perform git push origin master
Future improvements:
Step 1 can use an lfs filesize limit that has been specified in a config file.
Step 5 can be extended to handle merge conflicts via simple (yes|no|abort) options, where yes replaces all repo changes with local changes, no replaces all local changes with the repo state, and abort resets the local state to the last local commit.
Additionally, some complementary changes were made:
Git LFS threshold is now configurable
Git is setup automatically when using the arc init command
This PR adds the changes made in #39 to the main branch:
Additionally, some complementary changes were made:
arc init
commandarc git init
commandmain