Unable to resolve "unable to get local issuer certificate" using git on Windows with self-signed certificate
2022-10-25
Question I am using Git on Windows. I installed the msysGit package. My test repository has a self signed certificate at the server. I can access and use the repository using HTTP without problems. Moving to HTTPS gives the error: SSL Certificate problem: unable to get local issuer certificate. I have the self signed certificate installed in the Trusted Root Certification Authorities of my Windows 7 - client machine. I can browse to the HTTPS repository URL in Internet Explorer with no error messages.…
Force overwrite of local file with what's in origin repo?
2022-10-24
Question I want to get the latest file that's in the repository, and overwrite what I have locally. How can I do this with the git client? Answer If you want to overwrite only one file: git fetch git checkout origin/main <filepath> If you want to overwrite all changed files: git fetch git reset --hard origin/main (This assumes that you're working on main locally and you want the changes on the origin's main - if you're on a branch, or your project uses the old master main branch name rather than main, substitute that in instead.…
How to search through all Git and Mercurial commits in the repository for a certain string?
2022-10-24
Question I have a Git repository with few branches and dangling commits. I would like to search all such commits in repository for a specific string. I know how to get a log of all commits in history, but these don't include branches or dangling blobs, just HEAD's history. I want to get them all, to find a specific commit that got misplaced. I would also like to know how to do this in Mercurial, as I'm considering the switch.…
Remove last commit from remote Git repository
2022-10-24
Question How can I remove the last commit from a remote Git repository such as I don't see it any more in the log? If for example git log gives me the following commit history A->B->C->D[HEAD, ORIGIN] how can I go to A->B->C[HEAD,ORIGIN] Answer Be aware that this will create an "alternate reality" for people who have already fetch/pulled/cloned from the remote repository. But in fact, it's quite simple: git reset HEAD^ # remove commit locally git push origin +HEAD # force-push the new HEAD commit If you want to still have it in your local repository and only remove it from the remote, then you can use:…
How can I split up a Git commit buried in history?
2022-10-23
Question I flubbed up my history and want to do some changes to it. Problem is, I have a commit with two unrelated changes, and this commit is surrounded by some other changes in my local (non-pushed) history. I want to split up this commit before I push it out, but most of the guides I'm seeing have to do with splitting up your most recent commit, or uncommitted local changes.…
How can I rollback a git repository to a specific commit?
2022-10-22
Question My repo has 100 commits in it right now. I need to rollback the repository to commit 80, and remove all the subsequent ones. Why? This repo is supposed to be for merging from miscellaneous users. A bunch of merges went in as commits from me, due to excessive editing. That was due to a mislabeling of my remote branches, where 3 developers were labeled as each other. I need to reset to that point, and then pull forwards.…
What does "Changes not staged for commit" mean
2022-10-22
Question I thought if you want to track the files you should git add [files you want to track] I don't know why I got the messages Changes not staged for commit. If those files were not staged, shouldn't git shows me those files were Untracked like that All I've done was create a new feature from develop branch and worked in feature/change_excel_format branch I thought Those files should be in staged status,…