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

Perfecting the deploy:update #39

Closed
tamagokun opened this issue Jan 9, 2014 · 0 comments
Closed

Perfecting the deploy:update #39

tamagokun opened this issue Jan 9, 2014 · 0 comments

Comments

@tamagokun
Copy link
Owner

A few scenarios to discuss to try and perfect the update command:

Currently, the command is something along the lines of:

git reset --hard --quiet && git checkout branch --quiet && git pull --quiet

depending upon whether or not you specify a branch or revision.

Here is where some issues start to arise:

  • You are deploying some code that is on a new remote branch that hasn't been fetched yet. update will fail because it can't checkout a branch it doesn't know about. The same would go for tags and commit SHAs.
  • You specify your branch as remote/branch_name. This will move HEAD to a remote branch rather than a local branch and git pull will fail since you can't merge into a remote branch.

@leopoiroux does this make sense? I think it may be best to go back to using git fetch, but incorporate your additional checks for branch/revision.

Something like:

for branches:

git fetch --all --quiet && git reset --hard --quiet && git checkout branch --quiet

for revisions/versions:

git fetch --all --quiet && get reset --hard --quiet revision

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

No branches or pull requests

1 participant