简体   繁体   中英

Remove Unwanted files to a PR

I pushed my changes using git add. and then the standard commit and push. I opened the PR after and now see that a bunch of files were included (0ver 200) that are not needed (they are logs and some other automatically generated files).

How would I go about removing these unwanted files from the PR without manually deleting all of the near 250 files? Is there a way to pull down the changes, and somehow ignore the other files then push it back to the PR?

The pull request simply reflects the underlying branch. So you only need to remove the unwanted files from the feature branch to remedy this. Given that the feature branch has already been published, you might want to just make a new commit which removes the unwanted files. Just use:

# for each file
git rm <path/to/unwanted/file>
# commit changes
git commit -m 'removed over 200 unwanted files'
git push origin feature

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