FAQ

IndexTagsArchivesAbout
  • How do I ignore files in a directory in Git?

    2023-06-03

    Question What is the proper syntax for the .gitignore file to ignore files in a directory? Would it be config/databases.yml cache/* log/* data/sql/* lib/filter/base/* lib/form/base/* lib/model/map/* lib/model/om/* or /config/databases.yml /cache/* /log/* /data/sql/* /lib/filter/base/* /lib/form/base/* /lib/model/map/* /lib/model/om/* ? Answer PATTERN FORMAT A blank line matches no files, so it can serve as a separator for readability. A line starting with # serves as a comment. An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again.…

    #git

  • Should I use past or present tense in git commit messages? [closed]

    2023-06-02

    Question Closed. This question is opinion-based. It is not currently accepting answers. </div> Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 9 years ago. Improve this question I read once that git commit messages should be in the imperative present tense, e.g. "Add tests for x". I always find myself using the past tense, e.g. "Added tests for x"…

    #git

  • Git error - gpg failed to sign data

    2023-05-31

    Question I just started using git and I install git and gpg via homebrew. For some reason, I get this error when i do git commit I looked at so many other stackoverflow questions regarding this topic and none of them worked for me. How can I fix this error so that I can upload successfully. error: gpg failed to sign the data fatal: failed to write commit object Answer For troubleshooting, two things to first try:…

    #git

  • How do you fix a bad merge, and replay your good commits onto a fixed merge?

    2023-05-31

    Question I accidentally committed an unwanted file (filename.orig while resolving a merge) to my repository several commits ago, without me noticing it until now. I want to completely delete the file from the repository history. Is it possible to rewrite the change history such that filename.orig was never added to the repository in the first place? Answer Please don't use this recipe if your situation is not the one described in the question.…

    #git

  • In what cases could `git pull` be harmful?

    2023-05-31

    Question I have a colleague who claims that git pull is harmful, and gets upset whenever someone uses it. The git pull command seems to be the canonical way to update your local repository. Does using git pull create problems? What problems does it create? Is there a better way to update a git repository? Answer Summary By default, git pull creates merge commits which add noise and complexity to the code history.…

    #git

  • Various ways to remove local Git changes

    2023-05-31

    Question I just cloned a git repository and checked out a branch. I worked on it, and then decided to remove all my local changes, as I wanted the original copy. In short, I had to do the following two commands to remove my local changes git checkout . git clean -f My question is, (1) Is this the correct approach in getting rid of local changes, or else please let me know the correct approach.…

    #git

  • How do you use "git --bare init" repository?

    2023-05-30

    Question I need to create a central Git repository but I'm a little confused... I have created a bare repository (in my git server, machine 2) with: $ mkdir test_repo $ git --bare init Now I need to push files from my local repository (machine 1) to the bare repository (machine 2). I have access to machine 2 by SSH. The thing is that I think I don't understand the concept of a bare repository.…

    #git

  • «
  • 16
  • 17
  • 18
  • 19
  • 20
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^