FAQ

IndexTagsArchivesAbout
  • Why doesn't Git ignore my specified file?

    2022-04-21

    Question I added the following line to .gitignore: sites/default/settings.php but when I type git status it shows the file as unstaged file. What's the problem? All other patterns work well. Answer Make sure that your .gitignore is in the root of the working directory, and in that directory run git status and copy the path to the file from the status output and paste it into the .gitignore. If that doesn’t work, then it’s likely that your file is already tracked by Git.…

    #git

  • Change first commit of project with Git? [duplicate]

    2022-04-18

    Question This question already has answers here: </div> Edit the root commit in Git? (5 answers) Closed 10 years ago. I want to change something in the first commit of my project with out losing all subsequent commits. Is there any way to do this? I accidentally listed my raw email in a comment within the source code, and I'd like to change it as I'm getting spammed from bots indexing GitHub.…

    #git

  • How do I commit only some files?

    2022-04-18

    Question I have two projects. One is the "official" project and the second is a light modification (some files added). I created new branch and I put new files to them. But in during development some files common to both branches is changed. How do I commit only these files? Answer I suppose you want to commit the changes to one branch and then make those changes visible in the other branch.…

    #git

  • Git refusing to merge unrelated histories on rebase

    2022-04-17

    Question During git rebase origin/development the following error message is shown from Git: fatal: refusing to merge unrelated histories Error redoing merge 1234deadbeef1234deadbeef My Git version is 2.9.0. It used to work fine in the previous version. How can I continue this rebase allowing unrelated histories with the forced flag introduced in the new release? Answer You can use --allow-unrelated-histories to force the merge to happen. The reason behind this is that default behavior has changed since Git 2.…

    #git

  • Git submodule add: "a git directory is found locally" issue

    2022-04-17

    Question I'm actually trying to learn how to use git, including the git submodule subcommands. I already set up a server on which I can host, push and pull git repositories by using SSH. I created a main git repository "Travail" on this server in which I would like to put all my projects as submodules. In my Travail repository, I already added a project of mine as a submodule at tools/libft: I'm able to develop this submodule, to push and to pull it.…

    #git

  • How to remove/delete a large file from commit history in the Git repository?

    2022-04-17

    Question I accidentally dropped a DVD-rip into a website project, then carelessly git commit -a -m ..., and, zap, the repo was bloated by 2.2 gigs. Next time I made some edits, deleted the video file, and committed everything, but the compressed file is still there in the repository, in history. I know I can start branches from those commits and rebase one branch onto another. But what should I do to merge the 2 commits so that the big file doesn't show in the history and is cleaned in the garbage collection procedure?…

    #git

  • How would Git handle a SHA-1 collision on a blob?

    2022-04-17

    Question This probably never happened in the real-world yet, and may never happen, but let's consider this: say you have a git repository, make a commit, and get very very unlucky: one of the blobs ends up having the same SHA-1 as another that is already in your repository. Question is, how would Git handle this? Simply fail? Find a way to link the two blobs and check which one is needed according to the context?…

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