Get the creation date of a stash
2022-07-31
Question Is there a way to tell when a stash was created? git stash list only lists the stashes, and git stash show XXXXXX shows all the files and changes, but not the date of the stash creation. Answer Try: git stash list --date=local It should print something like: stash@{Thu Mar 21 10:30:17 2013}: WIP on master: 2ffc05b Adding resource
Vim for Windows - What do I type to save and exit from a file?
2022-07-31
Question Using Windows XP I accidentally typed git commit -a instead of git commit -am "My commit message", and now I'm viewing my CMD prompt filled with the file version of my commit message ("Please enter the commit message for your..."). I've added my message to the top, but now I can't figure out how to save and leave. I tried to press Ctrl + W + Q, but it doesn't do anything, but add ^ where the cursor is.…
What is the difference between merge --squash and rebase?
2022-07-31
Question I'm trying to understand the difference between a squash and a rebase. As I understand it, one performs a squash when doing a rebase. Answer Merge commits: retains all of the commits in your branch and interleaves them with commits on the base branch Merge Squash: retains the changes but omits the individual commits from history Rebase: This moves the entire feature branch to begin on the tip of the master branch, effectively incorporating all of the new commits in master…
Combine two columns of text in pandas dataframe
2022-07-30
Question I have a 20 x 4000 dataframe in Python using pandas. Two of these columns are named Year and quarter. I'd like to create a variable called period that makes Year = 2000 and quarter= q2 into 2000q2. Can anyone help with that? Answer If both columns are strings, you can concatenate them directly: df["period"] = df["Year"] + df["quarter"] If one (or both) of the columns are not string typed, you should convert it (them) first,…
Git Bash is extremely slow on Windows 7 x64
2022-07-29
Question I've been using Git on both Windows and Ubuntu during the development of a small project, frequently flipping back and forth between the two. The issue is that Git Bash consistently becomes slow. When I say slow, I mean that running cd takes anywhere from 8-25 seconds, running git commands take from 5-20 seconds, and ls can take up to 30 seconds sometimes. Needless to say, this is not fun, not to mention unproductive.…
How do I set GIT_SSL_NO_VERIFY for specific repos only?
2022-07-28
Question I have to use a git server without proper certificates, but I don't want to have to do env GIT_SSL_NO_VERIFY=true git command every single time I do a git operation. But I would also like to leave SSL enabled for other git repositories. Is there a way to make this local to a single repo? Answer You can do git config http.sslVerify "false" in your specific repo to disable SSL certificate checking for that repo only.…
How to migrate GIT repository from one server to a new one
2022-07-28
Question I have a server that I'm taking down. The only thing I have left to migrate is my repository. This server is listed as the origin (master) for one of my projects. What is the proper way to move the repository to keep the history. Answer To add the new repo location, git remote add new_repo_name new_repo_url Then push the content to the new location git push new_repo_name master Finally remove the old one…