How can I undo pushed commits using git?

You can revert individual commits with: git revert <commit_hash> This will create a new commit which reverts the changes of the commit you specified. Note that it only reverts that specific commit, and not commits that come after that. If you want to revert a range of commits, you can do it like this: git … Read more

Message “Support for password authentication was removed. Please use a personal access token instead.”

From August 13, 2021, GitHub is no longer accepting account passwords when authenticating Git operations. You need to add a PAT (Personal Access Token) instead, and you can follow the below method to add a PAT on your system. Create Personal Access Token on GitHub From your GitHub account, go to Settings => Developer Settings … Read more

master branch and ‘origin/master’ have diverged, how to ‘undiverge’ branches’?

You can review the differences with a: git log HEAD..origin/master before pulling it (fetch + merge) (see also “How do you get git to always pull from a specific branch?”) When you have a message like: “Your branch and ‘origin/master’ have diverged, # and have 1 and 1 different commit(s) each, respectively.” , check if … Read more

Git push rejected after feature branch rebase

The problem is that git push assumes that remote branch can be fast-forwarded to your local branch, that is that all the difference between local and remote branches is in local having some new commits at the end like that: Z–X–R <- origin/some-branch (can be fast-forwarded to Y commit) \ T–Y <- some-branch When you … Read more

Where is the global git config data stored?

Update 2016: with git 2.8 (March 2016), you can simply use: git config –list –show-origin And with Git 2.26 (Q1 2020), you can add a –show-scope option git config –list –show-origin –show-scope You will see which config is set where. See “Where do the settings in my Git configuration come from?” As Stevoisiak points out … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)