Git error: "Host Key Verification Failed" when connecting to remote repository
2023-02-01
Question I am trying to connect to a remote Git repository that resides on my web server and clone it to my machine. I am using the following format for my command: git clone ssh://username@domain.example/repository.git This has worked fine for most of my team members. Usually after running this command Git will prompt for the user's password, and then run the cloning. However, when running on one of my machines I get the following error:…
git: fatal: Could not read from remote repository
2023-02-01
Question I am trying to set git up with http://danielmiessler.com/study/git/#website to manage my site. I have gotten to the last step in the instructions: git push website +master:refs/heads/master I am working using the git ming32 command line in win7 $ git push website +master:refs/heads/master Bill@***.com's password: Connection closed by 198.91.80.3 fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. One problem here may be that the program is looking for Bill@***.…
How to tag an older commit in Git?
2023-02-01
Question We are new to git, and I want to set a tag at the beginning of our repository. Our production code is the same as the beginning repository, but we've made commits since then. A tag at the beginning would allow us to "roll back" production to a known, stable state. So how to add a tag to an arbitrary, older commit? Answer Example: git tag -a v1.2 9fceb02 -m "…
Remove directory from remote repository after adding them to .gitignore
2023-02-01
Question I committed and pushed some directory to github. After that, I altered the .gitignore file adding a directory that should be ignored. Everything works fine, but the (now ignored) directory stays on github. How do I delete that directory from github and the repository history? Answer The rules in your .gitignore file only apply to untracked files. Since the files under that directory were already committed in your repository, you have to unstage them, create a commit, and push that to GitHub:…
How can I undo pushed commits using git?
2023-01-31
Question I have a project in a remote repository, synchronized with a local repository (development) and the server one (prod). I've been making some commited changes already pushed to remote and pulled from the server. Now, I want to undo those changes. So I could just git checkout to the commit before the changes and commit the new changes, but I'm guessing that there will be problems to push them again to remote.…
How to color the Git console?
2023-01-31
Question I recently saw that the git console in Windows is colored, e.g. Green for additions, red for deletions, etc. How do I color my git console like that? To install it, I used the command: $ sudo apt-get install git-core Answer As noted by @VonC, color.ui defaults to auto since Git 1.8.4 From the Unix & Linux Stackexchange question How to colorize output of git? and the answer by @Evgeny:…
How to get rid of "would clobber existing tag"
2023-01-31
Question I'm using git in VSCodium and each time I try to pull git is complaining. Looking into the log I see > git pull --tags origin master From https://github.com/MY/REPO * branch master -> FETCH_HEAD ! [rejected] latest -> latest (would clobber existing tag) 9428765..935da94 master -> origin/master Doing the command with --force helps until the next time. It's unclear to me what's going wrong here. What happened and how can I resolve this issue?…