How do I expand the output display to see more columns of a Pandas DataFrame?
2023-05-10
Question Is there a way to widen the display of output in either interactive or script-execution mode? Specifically, I am using the describe() function on a Pandas DataFrame. When the DataFrame is five columns (labels) wide, I get the descriptive statistics that I want. However, if the DataFrame has any more columns, the statistics are suppressed and something like this is returned: >> Index: 8 entries, count to max >> Data columns: >> x1 8 non-null values >> x2 8 non-null values >> x3 8 non-null values >> x4 8 non-null values >> x5 8 non-null values >> x6 8 non-null values >> x7 8 non-null values The "…
See what's in a stash without applying it
2023-05-10
Question This question already has answers here: </div> How do I preview stash contents in Git? (18 answers) </span> Closed 3 years ago. How do I see what is inside a stash without actually applying it? Answer From man git-stash (which can also be obtained via git help stash): The modifications stashed away by this command can be listed with git stash list, inspected with git stash show, and ...…
How can I unstage my files again after making a local commit?
2023-05-08
Question I have executed the following command git add <foo.java> git commit -m "add the foo.java file" How can I delete my local commit now and unstage foo.java? If I type git reset --hard, I found that it reverts my modified foo.java to the original one. Answer git reset --soft HEAD~1 should do what you want. After this, you'll have the first changes in the index (visible with git diff --cached), and your newest changes not staged.…
How to "git pull" from master into the development branch
2023-05-08
Question I have a branch called "dmgr2" in development, and I want to pull from the master branch (live site) and incorporate all the changes into my development branch. Is there a better way to do this? Here is what I had planned on doing, after committing changes: git checkout dmgr2 git pull origin master This should pull the live changes into my development branch, or do I have this wrong?…
Link to the issue number on GitHub within a commit message
2023-05-08
Question Is it somehow possible to automatically have a link to GitHub issue number in the git commit message? Answer Just include #xxx in your commit message to reference an issue without closing it. With new GitHub issues 2.0 you can use these synonyms to reference an issue and close it (in your commit message): fix #xxx fixes #xxx fixed #xxx close #xxx closes #xxx closed #xxx resolve #xxx resolves #xxx resolved #xxx You can also substitute #xxx with gh-xxx.…
Difference between author and committer in Git?
2023-05-07
Question I am trying to make a commit like git commit --author="John Doe <john@doe.com>" -m "<the usual commit message>" where John Doe is some user in whose name I want to make the commit. It appears all right in git log. However, when I do a gitk, the author name is correct, but the committer name is picked from my global git config settings (and is thus set to my name/email).…
How to diff a commit with its parent
2023-05-07
Question Aside from writing an alias or script, is there a shorter command for getting the diff for a particular commit? git diff 15dc8^..15dc8 If you only give the single commit id git diff 15dc8, it diffs that commit against HEAD. Answer Use git show $COMMIT. It'll show you the log message for the commit, and the diff of that particular commit.