Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack.sh should update checkouts #52

Closed
wants to merge 1 commit into from
Closed

Conversation

anotherjesse
Copy link
Contributor

this will overwrite local changes.

any clues on how to not do that?

mkdir -p $GIT_DEST
git clone $GIT_ORIGIN $GIT_DEST
else
# FIXME(ja) if $ORIGIN has changed, should we update it?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If origin has changed, mayybe just rm/mv the entire directory and clone from scratch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like this could update the origin:

git remote rm origin
git remote add origin $GIT_ORIGIN
git fetch

@sleepsonthefloor
Copy link
Contributor

Some comments inline above, but in summary I think the following would be nice:

  • If there are local changes (or un-pushed commits), ask user if it is ok to delete them. Abort running if answer is no.
  • If origin has changed, make sure that the code is switched accordingly. I'd be ok with a clean checkout in this circumstance, but an origin switch would probably be fine but possibly more clunky
  • Switch to a syntax for checking out a clean branch that works with tags - swapping out your git reset strategy may be enough to pull that off

@anotherjesse
Copy link
Contributor Author

we aren't going to merge this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants