Open
Conversation
Isha-Sharma
reviewed
Jan 19, 2024
added 3 commits
January 22, 2024 11:39
* Optionally include branch to pull from, defaults to "main"
* cd || exit is a popular pattern to make sure your program exits if cd fails, but there is no change cd fails in this scenario as we are performing mkdir in the previous step, so removing "|| exit"
rickygarg
reviewed
Feb 21, 2024
| if [ "$(git remote show | wc -l)" = "0" ]; then | ||
| git remote add origin "$REMOTE" | ||
| fi | ||
| git config core.sparseCheckout true |
Contributor
There was a problem hiding this comment.
I don't want to make permanent changes to my config. Can we enable flag only on commands that need it.
rickygarg
reviewed
Feb 21, 2024
git/sparse_checkout.sh
Outdated
| fi | ||
|
|
||
| # This specifies the remote URL from which to fetch from | ||
| REMOTE="$(echo "$URL" | sed -n 's|\(.*github.com\)/\([^/]*\)/\([^/]*\)/\(.*\)|\1/\2/\3.git|p')" |
Contributor
There was a problem hiding this comment.
Can it be generic so that it works on non github.com URLs also
If it's easier, we can just ask for these three params separately, instead of deriving from URL
missing files did not restore the missing files + fixed issue where running this script did not pull remote changes to local
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Git Sparse checkout script for selectively cloning folders from a repository