FAQ

IndexTagsArchivesAbout
  • Completely cancel a rebase

    2023-03-13

    Question I performed a rebase like this: git rebase --onto master new_background_processing export_background_processing That didn't do what I wanted it to, so I performed a reset: git reset --hard HEAD@{1} I got my branch back to the state it was, but I received this message when I type git status: # You are currently rebasing branch 'export_background_processing' on 'e378641'. How do I cancel that rebase completely? Not sure what that means per se.…

    #git

  • How can I generate a Git patch for a specific commit?

    2023-03-12

    Question I need to write a script that creates patches for a list of SHA-1 commit numbers. I tried using git format-patch <the SHA1>, but that generated a patch for each commit since that SHA-1 value. After a few hundred patches were generated, I had to kill the process. Is there a way to generate a patch only for the specific SHA-1 value? Answer Try: git format-patch -1 <sha> or…

    #git

  • How do I configure git to ignore some files locally?

    2023-03-12

    Question Can I ignore files locally without polluting the global git config for everyone else? I have untracked files that are spam in my git status but I don't want to commit git config changes for every single little random untracked file I have in my local branches. Answer From the relevant Git documentation: Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.…

    #git

  • How to clone git repository with specific revision/changeset?

    2023-03-12

    Question How can I clone git repository with specific revision, something like I usually do in Mercurial: hg clone -r 3 /path/to/repository Answer $ git clone $URL $ cd $PROJECT_NAME $ git reset --hard $SHA1 To again go back to the most recent commit $ git pull To save online (remote) the reverted commit, you must to push enforcing origin: git push origin -f

    #git

  • Need to reset git branch to origin version

    2023-03-12

    Question I was accidentally working on a branch I shouldn't have been for a while, so I branched off of it giving it the appropriate name. Now I want to overwrite the branch I shouldn't have been on to the version from origin (github). Is there an easy way to do this? I tried deleting the branch and then resetting up the tracking branch, but it just gives me the version I was working on again.…

    #git

  • How do I delete unpushed git commits?

    2023-03-11

    Question I accidentally committed to the wrong branch. How do I delete that commit? Answer Delete the most recent commit, keeping the work you've done: git reset --soft HEAD~1 Delete the most recent commit, destroying the work you've done: git reset --hard HEAD~1

    #git

  • List Git aliases

    2023-03-11

    Question How do I print a list of my git aliases, i.e., something analogous to the bash alias command? Answer You can use --get-regexp with the regular expression ^alias, ie all configurations that start with alias git config --get-regexp ^alias

    #git

  • «
  • 31
  • 32
  • 33
  • 34
  • 35
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^