简体   繁体   中英

How do I tell Git to ignore a project?

I don't want my development branch or the Test project of my project in my DevOps project. I pushed everything from my computer when I got DevOps set up. But I didn't think about the test project until it was too late. Now I want to "ignore" the Test project but there is no apparent way to do that. Of course, the project is fully located in the WaterTests folder. So is there a way to tell git to ignore a folder?

If you want to remove a remote branch, simply run:

git push origin -d branch
# this removes the remote branch, the local one is preserved

To ignore a folder within your project, the most suitable git feature is to use a .gitignore file.

As described in the answer suggested as duplicate, since the folder is already tracked, you will also need to apply an action to remove it from tracking:

git rm --cached path/to/folder

If you have several branches, you will need to repeat these actions (adding a .gitignore file and rm --cached the existing one) on all branches.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM