Fetching colleague’s fork on Github

I am currently using Github and all project members have forked the main repository into private repository. Now the problem is that I need to review my colleagues code committed in his branch inside his forked repository. So to do this I found out a good article that showed me exactly how to do that. I used the following approach.

git remote add my-colleague https://github.xyz.com/my-colleague/project.git

git fetch my-colleague

git checkout -b my-colleague-branch --track my-colleague/branch

After I do this I can see all the work done by my colleague and I can switch back to my branch anytime.

Leave a Reply

Your email address will not be published. Required fields are marked *