ignoring any 'bin' directory on a git project

前端 未结 15 1834
暖寄归人
暖寄归人 2020-11-22 16:45

I have a directory structure like this:

.git/
.gitignore
main/
  ...
tools/
  ...
...

Inside main and tools, and any other directory, at an

15条回答
  •  Happy的楠姐
    2020-11-22 17:13

    Step 1: Add following content to the file .gitignore.

    # User-specific files
    *.suo
    *.user
    *.userosscache
    *.sln.docstates
    
    # Build results
    [Dd]ebug/
    [Dd]ebugPublic/
    [Rr]elease/
    [Rr]eleases/
    x64/
    x86/
    bld/
    [Bb]in/
    [Oo]bj/
    
    # Visual Studio 2015 cache/options directory
    .vs/

    Step 2: Make sure take effect

    If the issue still exists, that's because settings in .gitignore can only ignore files that were originally not tracked. If some files have already been included in the version control system, then modifying .gitignore is invalid. To solve this issue completely, you need to open Git Bash or Package Manager Console (see screenshot below) to run following commands in the repository root folder.

    $ git rm -r --cached .
    $ git add .
    $ git commit -m 'Update .gitignore'

    Then the issue will be completely solved.

提交回复
热议问题