FAQ

IndexTagsArchivesAbout
  • What exactly does git's 'rebase --preserve-merges' do (and why?)

    2022-12-30

    Question Git's documentation for the rebase command is quite brief: --preserve-merges Instead of ignoring merges, try to recreate them. This uses the –interactive machinery internally, but combining it with the –interactive option explicitly is generally not a good idea unless you know what you are doing (see BUGS below). So what actually happens when you use --preserve-merges? How does it differ from the default behavior (without that flag)? What does it mean to "…

    #git

  • Applying .gitignore to committed files

    2022-12-28

    Question I have committed loads of files that I now want to ignore. How can I tell git to now ignore these files from future commits? EDIT: I do want to remove them from the repository too. They are files created after ever build or for user-specific tooling support. Answer After editing .gitignore to match the ignored files, you can do git ls-files -ci --exclude-standard to see the files that are included in the exclude lists; you can then do…

    #git

  • Ignoring directories in Git repositories on Windows

    2022-12-28

    Question How can I ignore directories or folders in Git using msysgit on Windows? Answer Create a file named .gitignore in your project's directory. Ignore directories by entering the directory name into the file (with a slash appended): dir_to_ignore/ More information is here.

    #windows

  • What are the differences between git remote prune, git prune, git fetch --prune, etc

    2022-12-27

    Question My situation is this... someone working on the same repo has deleted a branch from his local & remote repo... Most people who have asked about this kind of problem on Stack Overflow, or other sites have the issue of branches still showing in their remote tracking branch list git branch -a at the bottom: * master develop feature_blah remotes/origin/master remotes/origin/develop remotes/origin/feature_blah remotes/origin/random_branch_I_want_deleted However, in MY situation the branch that shouldn't be there, is local:…

    #git

  • How to exclude file only from root folder in Git

    2022-12-26

    Question I am aware of using .gitignore file to exclude some files being added, but I have several config.php files in source tree and I need to exclude only one, located in the root while other keep under revision control. What I should write into .gitignore to make this happen? Answer From the documentation: If the pattern does not contain a slash /, git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .…

    #git

  • Remove file from the repository but keep it locally

    2022-12-26

    Question I have a folder which I'd like to remove in my remote repository. I'd like to delete it, but keep the folder in my computer Answer git rm --cached -r somedir Will stage the deletion of the directory, but doesn't touch anything on disk. This works also for a file, like: git rm --cached somefile.ext Afterwards you may want to add somedir/ or somefile.ext to your .gitignore file so that git doesn't try to add it back.…

    #git

  • Unlink of file Failed. Should I try again?

    2022-12-25

    Question Something wrong is going on with one of the files in my local git repository. When I'm trying to change the branch it says: Unlink of file 'templates/media/container.html' failed. Should I try again? (y/n) What could that mean? Answer This could mean that another program is using the file, which is preventing git from "moving" the file into or out of the working directory when you are attempting to change branches.…

    #git

  • «
  • 56
  • 57
  • 58
  • 59
  • 60
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^