FAQ

IndexTagsArchivesAbout
  • Stash just a single file

    2022-04-10

    Question I'd like to be able to stash just the changes from a single file: git stash save -- just_my_file.txt The above doesn't work though. Any alternatives? Answer If you do not want to specify a message with your stashed changes, pass the filename after a double-dash. $ git stash -- filename.ext If it's an untracked/new file, you will have to stage it first. However, if you do want to specify a message, use push.…

    #git

  • How do you attach a new pull request to an existing issue on github?

    2022-04-09

    Question I'm not sure, but I have a vague memory of creating a github pull request with "Issue 4" or something in the title, and it automatically attached itself to Issue 4 in the project that I was submitting it to. I tried it again recently and it didn't work -- it just created a brand new issue instead. I don't see any options like "Attach to issue" on the new pull request page, nor "…

    #git

  • Force add despite the .gitignore file

    2022-04-08

    Question Is there a way to force git to add a file despite the .gitignore file? Answer See man git-add: -f, --force Allow adding otherwise ignored files. So run this git add --force my/ignore/file.foo

    #git

  • Temporarily switch working copy to a specific Git commit

    2022-04-07

    Question How to switch to specific Git commit without losing all the commits made after it? I want that local files will be changed, but commits' database will remain intact, only the current position pointer is set to currently selected commit. I want to change files' state to specific commit, run project and, when finished, restore files back to last commit. How to do this without zipping the whole project's folder?…

    #git

  • Warning: push.default is unset; its implicit value is changing in Git 2.0

    2022-04-07

    Question I've been using Git for a while now and have recently downloaded an update only to find this warning message come up when I try to push. warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config –global push.default matching To squelch this message and adopt the new behavior now, use:…

    #git

  • What's the simplest way to list conflicted files in Git?

    2022-04-07

    Question I just need a plain list of conflicted files. Is there anything simpler than: git ls-files -u | cut -f 2 | sort -u or: git ls-files -u | awk '{print $4}' | sort | uniq I guess I could set up a handy alias for that, however was wondering how pros do it. I'd use it to write shell loops e.g. to auto-resolve conflict, etc. Maybe replace that loop by plugging into mergetool.…

    #git

  • Handling file renames in Git

    2022-04-05

    Question I'd read that when renaming files in Git, you should commit any changes, perform your rename and then stage your renamed file. Git will recognise the file from the contents, rather than seeing it as a new untracked file, and keep the change history. However, doing just this tonight I ended up reverting to git mv. > $ git status # On branch master # Changes to be committed: # (use "…

    #git

  • «
  • 126
  • 127
  • 128
  • 129
  • 130
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^