GitHub Error Message - Permission denied (publickey)
2022-09-12
Question Anybody seen this error and know what to do? I'm using the terminal, I'm in the root, the GitHub repository exists and I don't know what to do now. > git push -u origin master Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Answer GitHub isn't able to authenticate you. So, either you aren't setup with an SSH key, because you haven't set one up on your machine, or your key isn't associated with your GitHub account.…
Git for Windows: .bashrc or equivalent configuration files for Git Bash shell
2022-09-11
Question I've just installed Git for Windows and am delighted to see that it installs Bash. I want to customise the shell in the same way I can under Linux (e.g. set up aliases like ll for ls -l), but I can't seem to find .bashrc or equivalent configuration files. What should I be editing? Answer Create a .bashrc file under ~/.bashrc and away you go. Similarly for ~/.gitconfig. ~ is usually your C:\Users\<your user name> folder.…
How to cherry-pick multiple commits
2022-09-11
Question I have two branches. Commit a is the head of one, while the other has b, c, d, e and f on top of a. I want to move c, d, e and f to first branch without commit b. Using cherry pick it is easy: checkout first branch cherry-pick one by one c to f and rebase second branch onto first. But is there any way to cherry-pick all c-f in one command?…
When to use "chore" as type of commit message?
2022-09-11
Question What is the use of chore in semantic version control commit messages? Other types like feat or fix are clear, but I don't know when to use "chore". Can anyone provide a couple of examples of its use? Another maybe not related question: What's the proper type of commit messages for modifying files like .gitignore? Answer You can see a short definition in "Git Commit Msg": chore: updating grunt tasks etc; no production code change…
Pandas Merging 101
2022-09-10
Question How can I perform a (INNER| (LEFT|RIGHT|FULL) OUTER) JOIN with pandas? How do I add NaNs for missing rows after a merge? How do I get rid of NaNs after merging? Can I merge on the index? How do I merge multiple DataFrames? Cross join with pandas merge? join? concat? update? Who? What? Why?! ... and more. I've seen these recurring questions asking about various facets of the pandas merge functionality.…
How to remove file from Git history?
2022-09-09
Question Some time ago I added info(files) that must be private. Removing from the project is not problem, but I also need to remove it from git history. I use Git and Github (private account). Note: On this thread something similar is shown, but here is an old file that was added to a feature branch, that branch merged to a development branch and finally merged to master, since this, a lot of changes was done.…
Print commit message of a given commit in git
2022-09-08
Question I need a plumbing command to print the commit message of one given commit - nothing more, nothing less. Answer It's not "plumbing", but it'll do exactly what you want: $ git log --format=%B -n 1 <commit> If you absolutely need a "plumbing" command (not sure why that's a requirement), you can use rev-list: $ git rev-list --format=%B --max-count=1 <commit> Although rev-list will also print out the commit sha (on the first line) in addition to the commit message.…