简体   繁体   中英

“Export” a local branch in git for Visual Studio 2019

I'm sure it's a dumb question, but I've never used git before. I'm using the git extension for Visual Studio 2019, cloned a remote repository, created a new local branch and created/modified some files. I don't want to push my local changes to the remote server, but send my local changes to a research fellow. Is there a way to send him only the newly added/modified files?

Depending on the type of connectivity which exists between your workstation and your research fellow, you could simply bundle your repo .

Bundle only your branch (especially is the repo is huge)

git bundle create ../abundle yourBranch

Or even with less commits (very small bundle, assuming yourBranch comes from master )

git bundle create ../aBundle master..yourBranch

That will give you one file, which is easy to copy around/send to your colleague.
Said colleague will be able to fetch from it, getting your branch in the process.

The other approach is to generate a patch from your branch (that would hide the history of all commits in that branch though)

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