To revert changes such that remote production’s `HEAD` is in sync with local production will require several additional steps, one of which will be to resolve a merge conflict:ĥ - In your Git Provider, create a new branch from the specific commit you reverted local production to in steps 2-3Ħ - In Looker, switch to that branch in the IDE, toggle Advanced Deploy OFF, and hit “Deploy to Production”. Thus, if you say, “Revert to Production” while in dev mode, your dev branch will pull from the faulty `HEAD` that you reverted in previous steps. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. However, the ` HEAD` of your remote production branch will have been unchanged. The revert command The revert command will create a commit that reverts the changes of the commit being targeted. We'll look at both of them in this article. Note: At this point, your local production code will now have been reverted to the specified commit. There are two possible ways to undo your last commit. curl -i -X POST -H "X-Looker-Deploy-Secret:" 4 - Re-enter Production in your project. Edit existing answers to improve this post. You can now make new commits on top of this old commit without affecting the branch your head is on. To temporarily jump back to that commit, detach your head with: git checkout 789abcd This places you at commit 789abcd. Grab the commit SHA, eg e289a61, of the commit you would like to revert to.ģ - Hit the SHA Advanced Deploy webhook using curl. git checkout - How do I revert a Git repository to a previous commit - Stack Overflow How do I revert a Git repository to a previous commit Ask Question Asked 12 years, 8 months ago Modified 20 days ago Viewed 10.0m times 7611 This question's answers are a community effort. To jump back to a previous commit, first find the commit's hash using git log. Copy the secret, you will need it in step 3.Ģ - In Your Git Provider: Find the specific commit you would like to revert to in the commit history of the Production Branch Must use a non-looker hosted repository which you have credentials to accessġ - In Looker’s Project Settings, enable “ Advanced Deploy” and set a Webhook Secret.3 Commands to enable git revert to previous commit Git works by tracking changes made to the code. The simplest way to start using it is to understand its significance in git workflow and syntax by going through various examples, as you will see in this article. Your Looker instance must be accessible from the public internet, or you must be able to curl to the instance from command line git revert to previous commit is a safe way to undo code changes.Must be on a version that supports advanced deploy and have it enabled Right-click on the previous commit, and youll see the option to revert this commit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |