FAQ

IndexTagsArchivesAbout
  • how to delete all commit history in github? [duplicate]

    2023-04-25

    Question This question already has answers here: </div> Make the current commit the only (initial) commit in a Git repository? (18 answers) Closed 7 years ago. I want to delete all commit history but keep the code in its current state because, in my commit history, there are too many unused commits. How can I do it? Is there any git command can do this? git filter-branch ? git rebase ?…

    #git

  • How to revert to origin's master branch's version of file

    2023-04-25

    Question I'm in my local computer's master branch of a cloned master-branch of a repo from a remote server. I updated a file, and I want to revert back to the original version from the remote master branch. How can I do this? Answer Assuming you did not commit the file, or add it to the index, then: git checkout -- filename Assuming you added it to the index, but did not commit it, then:…

    #git

  • Git Commit Messages: 50/72 Formatting

    2023-04-23

    Question Tim Pope argues for a particular Git commit message style in his blog post: http://www.tpope.net/node/106. Here is a quick summary of what he recommends: First line is 50 characters or less. Then a blank line. Remaining text should be wrapped at 72 characters. His blog post gives the rationale for these recommendations (which I will call “50/72 formatting” for brevity): In practice, some tools treat the first line as a subject line and the second paragraph as a body (similar to email).…

    #git

  • Git on Windows: How do you set up a mergetool?

    2023-04-23

    Question I've tried msysGit and Git on Cygwin. Both work just fine in and of themselves and both run gitk and git-gui perfectly. Now how the heck do I configure a mergetool? (Vimdiff works on Cygwin, but preferably I would like something a little more user-friendly for some of our Windows-loving coworkers.) Answer To follow-up on Charles Bailey's answer, here's my git setup that's using p4merge (free cross-platform 3way merge tool); tested on msys Git (Windows) install:…

    #windows

  • How do I ignore an error on 'git pull' about my local changes would be overwritten by merge?

    2023-04-23

    Question How do I ignore the following error message on Git pull? Your local changes to the following files would be overwritten by merge What if I want to overwrite them? I've tried things like git pull -f, but nothing works. To be clear, I only want to overwrite specific changes, not everything. Answer If you want remove all local changes - including files that are untracked by git - from your working copy, simply stash them:…

    #git

  • How to squash commits in git after they have been pushed?

    2023-04-23

    Question This gives a good explanation of squashing multiple commits: http://git-scm.com/book/en/Git-Branching-Rebasing but it does not work for commits that have already been pushed. How do I squash the most recent few commits both in my local and remote repos? When I do git rebase -i origin/master~4 master, keep the first one as pick, set the other three as squash, and then exit (via c-x c-c in emacs), I get: $ git rebase -i origin/master~4 master # Not currently on any branch.…

    #git

  • Create a Pandas Dataframe by appending one row at a time

    2023-04-22

    Question How do I create an empty DataFrame, then add rows, one by one? I created an empty DataFrame: df = pd.DataFrame(columns=('lib', 'qty1', 'qty2')) Then I can add a new row at the end and fill a single field with: df = df._set_value(index=len(df), col='qty1', value=10.0) It works for only one field at a time. What is a better way to add new row to df? Answer You can use df.loc[i], where the row with index i will be what you specify it to be in the dataframe.…

    #python

  • «
  • 26
  • 27
  • 28
  • 29
  • 30
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^