Need Assistance?

support@tutorialshub.in

Remote Repositories and Collaboration

Working with remote branches

ADVERTISEMENT
Git Free Lesson
5 min read
ADVERTISEMENT

Remote branches are shared references

Remote branches such as origin/main reflect the state known from the remote. They are updated when you fetch.

Do not edit origin/main directly

Remote-tracking branches are references maintained by Git. You normally create or update your local branch, then push your commits to the remote branch through the remote.

Clean stale references

When remote branches are deleted, your local repository can retain stale remote-tracking references until pruning occurs. git fetch --prune removes references that no longer exist on the remote.

ADVERTISEMENT