DEV Community

Cover image for Collaborate with Peers on GitHub
Nitin Reddy
Nitin Reddy

Posted on • Edited on

2 2

Collaborate with Peers on GitHub

If you are working in an organisation where GitHub is used as a source code hosting site, then this post will be a helpful one for you.

Nowadays, as devs, we are following some of the best practices like forking the repository from the main organisation's account, and we come across a situation wherein you want to collaborate with your peer on a feature and you decide to push the code on the same branch.

Github collaboration

Some of the commands that would work on the peer's forked repository (Can be followed in this order) :-

git remote add theirUsername https://github.com/theirUsername/repoName
Enter fullscreen mode Exit fullscreen mode
git fetch theirUsername
Enter fullscreen mode Exit fullscreen mode
git checkout -b myLocalBranch theirUsername/theirBranch
Enter fullscreen mode Exit fullscreen mode
git add/commit the changes
Enter fullscreen mode Exit fullscreen mode
git push https://github.com/theirUsername/repoName HEAD:branchName
Enter fullscreen mode Exit fullscreen mode
git pull https://github.com/theirUsername/repoName branchName
Enter fullscreen mode Exit fullscreen mode

Hope this post will help you in better collaboration in a long run.
Happy learning !!

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️