FAQ

IndexTagsArchivesAbout
  • How can I have multiple working directories with Git?

    2022-03-31

    Question I'm not sure if this is something supported by Git, but in theory it seems like it should work to me. My workflow often involves my editing of files in multiple branches simultaneously. In other words, I often want to open a few files in one branch is while I edit the contents of another file in another branch. My typical solution to this is to make two checkouts, but it's a shame I can't share branches and refs between them.…

    #git

  • How to ignore certain files in Git

    2022-03-31

    Question I have a repository with a file, Hello.java. When I compile it, an additional Hello.class file is generated. I created an entry for Hello.class in a .gitignore file. However, the file still appears to be tracked. How can I make Git ignore Hello.class? Answer The problem is that .gitignore ignores just files that weren't tracked before (by git add). Run git reset name_of_file to unstage the file and keep it.…

    #git

  • Git is not working after macOS update ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools")

    2022-03-30

    Question I updated to the latest OS, and/or restarted my computer (this happens on every major update, but this time all I did was restart my computer on 2022-09-13). This morning I navigated to my work's codebase in the command line on my MacBook Pro, typed in "git status" in the repository and received an error: (In 9/2022, this error was much different, but I didn't capture it) xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun…

    #xcode

  • Git Stash vs Shelve in IntelliJ IDEA/Netbeans

    2022-03-30

    Question I am very unfamiliar with the shelve aspect of Git (EDIT: not an aspect of Git, but rather IntelliJ IDEA feature of shelve). If stash is used to put aside unfinished work what is shelve then? What would you use it for? For example on Update Project (from VCS menu) one will get (in IntelliJ IDEA 2019.2) Answer git shelve doesn't exist in Git. Only git stash: when you want to record the current state of the working directory and the index, but want to go back to a clean working directory.…

    #git

  • Git undo local branch delete

    2022-03-30

    Question I just deleted the wrong branch with some experimental changes I need with git branch -D branchName. How do I recover the branch? Answer You can use git reflog to find the SHA1 of the last commit of the branch. From that point, you can recreate a branch using git branch branchName <sha1> Edit: As @seagullJS says, the branch -D command tells you the sha1, so if you haven't closed the terminal yet it becomes real easy.…

    #git

  • How to close git commit editor?

    2022-03-30

    Question I just executed a command $ git commit and it opens a new editor. But I'm trying to close that new commit editor. How to do this? I'm using Git for Windows. Answer Save the file in the editor. If it's Emacs: CTRLX CTRLS to save then CTRLX CTRLC to quit or if it's vi: :wq Press esc first to get out from editing. (in windows/vi)

    #git

  • Is there a naming convention for git repositories?

    2022-03-30

    Question For example, I have a RESTful service called Purchase Service. Should I name my repository: purchaserestservice purchase-rest-service purchase_rest_service or something else? What's the convention? How about in GitHub? Should public repositories follow some standard? Answer I'd go for purchase-rest-service. Reasons: What is "pur chase rests ervice"? Long, concatenated words are hard to understand. I know, I'm German. "Donaudampfschifffahrtskapitänspatentausfüllungsassistentenausschreibungsstellenbewerbung." "_" is harder to type than "-"

    #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 ^