简体   繁体   中英

Can one git branch bloat another in the same remote?

I have a git repository with a master branch on the origin remote. Other devs on the team are pushing their own dev/feature branches to the same remote. Eventually these branches will either be discarded, or squash -merged into master and later deleted.

Now some devs on the team are unfamiliar with git and are likely to bloat the history of their feature branches by adding binary files, etc. Eventually they will send a pull review request, which must be reviewed, and reviewers will enforce that no binaries are added.

In this scenario, I expect the dev/feature branches to be bloated (eg git might become slow, pulling/cloning them might take a while, etc). The question is whether this will cause any performance issues for people just working with other branches in the same remote that are not bloated.

The question is whether this will cause any performance issues for people just working with other branches in the same remote that are not bloated.

If the bloated branches are pushed, yes, it will impact other's performance, but only for git fetch (which includes git pull ). It will download the whole history and full content of every branch by default. There are various ways around this, like git clone --single-branch to get only master , but there's a better solution below.

But it should not affect other operations. git diff , git log , etc... should all be largely unaffected.

Rather than preventing people from putting binaries in version control, or cloning only certain branches, use git-lfs . This is the best of both worlds. You can put binary files in version control, but the actual content is stored outside the repository to avoid repository bloat.

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