-1

I use a push to deploy on a godaddy server. This strategy of course uses a checkout on each push to deploy the working directory to public_html.

Can I ssh in to the server and just checkout different "points in time".

I don't use branching. I mean I only use "master" branches so the development timeline is 100% linear.

What is the command to do this?

cade galt
  • 3,843
  • 8
  • 32
  • 48

1 Answers1

1

Can I ssh in to the server and just checkout different "points in time".

Yep,

If you want to checkout code at the given commit id use:

git checkout <commit id>

If you want to "remove" (undo) changes :

git revert commit1 commit2. .. commit n
git push origin master

Last but dangerous way: (rebase)

git reset HEAD --hard <commit id>

This will remove your commits and when you push you will lose all your changes + all your fellow will have to delete their master and to check it out again.

So you should go with the first way :-)

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • it's not working ... I tried `git checkout cf9` ... I'm assuming by commit id you mean the commit hash and I'm assuming it does not need quotes. – cade galt Jan 07 '16 at 00:35