Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Feature Forums
  3. - Uncategorised posts -
  4. Cannot add folders (with files) to the .gitignore file in VS Team Explorer

Cannot add folders (with files) to the .gitignore file in VS Team Explorer

Scheduled Pinned Locked Moved - Uncategorised posts -
visual-studiocsharpcollaborationquestion
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mc_Topaz
    wrote on last edited by
    #1

    (Not sure if this is the correct forum. I'll give it a try.) In my Visual Studio solution I have several projects. (ProjectA, ProjectB and so on...) My solution also contains a .gitignore-file. I would like to add all projects´ /bin and /obj folders to the .gitignore file. These folders, and files in them, always updates when I even the smallest changes. So when I want commit something in Team Explorer, I always see this folders and the files. I don't care about them. In other solutions, I have been able to add folders and files to the .gitignore file in the Team Explorer of my choosing. In those cases I have added the /bin and /obj folders. For this particular solution, this is not possible. I wonder what I'm doing wrong. Any suggestions?

    R 1 Reply Last reply
    0
    • M Mc_Topaz

      (Not sure if this is the correct forum. I'll give it a try.) In my Visual Studio solution I have several projects. (ProjectA, ProjectB and so on...) My solution also contains a .gitignore-file. I would like to add all projects´ /bin and /obj folders to the .gitignore file. These folders, and files in them, always updates when I even the smallest changes. So when I want commit something in Team Explorer, I always see this folders and the files. I don't care about them. In other solutions, I have been able to add folders and files to the .gitignore file in the Team Explorer of my choosing. In those cases I have added the /bin and /obj folders. For this particular solution, this is not possible. I wonder what I'm doing wrong. Any suggestions?

      R Offline
      R Offline
      Richard Deeming
      wrote on last edited by
      #2

      Are they not excluded by default?

      # Build results
      [Dd]ebug/
      [Dd]ebugPublic/
      [Rr]elease/
      [Rr]eleases/
      x64/
      x86/
      [Aa][Rr][Mm]/
      [Aa][Rr][Mm]64/
      bld/
      [Bb]in/
      [Oo]bj/
      [Ll]og/


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      M D 2 Replies Last reply
      0
      • R Richard Deeming

        Are they not excluded by default?

        # Build results
        [Dd]ebug/
        [Dd]ebugPublic/
        [Rr]elease/
        [Rr]eleases/
        x64/
        x86/
        [Aa][Rr][Mm]/
        [Aa][Rr][Mm]64/
        bld/
        [Bb]in/
        [Oo]bj/
        [Ll]og/


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        M Offline
        M Offline
        Mc_Topaz
        wrote on last edited by
        #3

        I can find the same list of items in my .gitignore. But still the /bin and /obj folders and files are shown in the changes dialog. Here are the items I don't want. Solution folder /.vs folder, sub folders and files. Project A /bin/Debug folder and files. /obj folder, sub folders and files. Project B /bin/Debug folder and files. /obj folder and files. Project C /bin/Debug folder and files.

        R 1 Reply Last reply
        0
        • M Mc_Topaz

          I can find the same list of items in my .gitignore. But still the /bin and /obj folders and files are shown in the changes dialog. Here are the items I don't want. Solution folder /.vs folder, sub folders and files. Project A /bin/Debug folder and files. /obj folder, sub folders and files. Project B /bin/Debug folder and files. /obj folder and files. Project C /bin/Debug folder and files.

          R Offline
          R Offline
          Richard Deeming
          wrote on last edited by
          #4

          Did you add or update the .gitignore file after checking your project in for the first time?


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          M 1 Reply Last reply
          0
          • R Richard Deeming

            Did you add or update the .gitignore file after checking your project in for the first time?


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            M Offline
            M Offline
            Mc_Topaz
            wrote on last edited by
            #5

            Unfortunately I did not. Several commits after the first commit I added the .gitgnore-file. :(( I'm looking for the "Ignore this local item" selection. Please see the answer in this link from StackOverFlow. This option only seem to be available before doing the first commit. I don't understand why. Is there a solution for me?

            R 1 Reply Last reply
            0
            • M Mc_Topaz

              Unfortunately I did not. Several commits after the first commit I added the .gitgnore-file. :(( I'm looking for the "Ignore this local item" selection. Please see the answer in this link from StackOverFlow. This option only seem to be available before doing the first commit. I don't understand why. Is there a solution for me?

              R Offline
              R Offline
              Richard Deeming
              wrote on last edited by
              #6

              Once you've committed a file to Git, it will be tracked even if you update the .gitignore file to exclude it. You'll need to delete your local copy of the file, commit your changes, and then restore your local copy. In this case, try cleaning the solution, committing the changes, and then rebuilding.


              "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

              A M 2 Replies Last reply
              0
              • R Richard Deeming

                Once you've committed a file to Git, it will be tracked even if you update the .gitignore file to exclude it. You'll need to delete your local copy of the file, commit your changes, and then restore your local copy. In this case, try cleaning the solution, committing the changes, and then rebuilding.


                "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                A Offline
                A Offline
                alex_johnson
                wrote on last edited by
                #7

                Thanks for the information. It was very useful.[

                solar inverter price list

                ](https://solarpanelcostprice.com.au/solar-inverters/)

                1 Reply Last reply
                0
                • R Richard Deeming

                  Once you've committed a file to Git, it will be tracked even if you update the .gitignore file to exclude it. You'll need to delete your local copy of the file, commit your changes, and then restore your local copy. In this case, try cleaning the solution, committing the changes, and then rebuilding.


                  "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                  M Offline
                  M Offline
                  Mc_Topaz
                  wrote on last edited by
                  #8

                  Thank you for that tip! I deleted the folders and files. Commited the deleted stuff. Now VS will not try to include the /bin and /obj folders and files in every commit. Thank you!

                  1 Reply Last reply
                  0
                  • R Richard Deeming

                    Are they not excluded by default?

                    # Build results
                    [Dd]ebug/
                    [Dd]ebugPublic/
                    [Rr]elease/
                    [Rr]eleases/
                    x64/
                    x86/
                    [Aa][Rr][Mm]/
                    [Aa][Rr][Mm]64/
                    bld/
                    [Bb]in/
                    [Oo]bj/
                    [Ll]og/


                    "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                    D Offline
                    D Offline
                    debtadvice
                    wrote on last edited by
                    #9

                    I think this is right. But I am not sure. Let me try once. debt advice

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups