Urgent.News

What's breaking now, across thousands of outlets.

Tech

Git Clone vs Fork: Stop Mixing Them Up

Differentiating between git clone and git fork

Git Clone vs Fork: Stop Mixing Them Up

Cloning and forking are two distinct concepts in Git that often get mixed up. Cloning involves copying a repository, complete with its full history, onto your local machine using the git clone command. This creates a local copy of the remote repository that you can modify and push changes to, provided you have write access. On the other hand, forking is a GitHub (or GitLab) feature that creates a personal copy of a repository in your own account on the server.

You cannot push changes to a repository you don't have write access to, which is where forking comes in handy. By forking a project, you get a copy you can push changes to and create pull requests to suggest changes to the original maintainers.

The workflow for contributing to an open-source project typically involves forking the upstream repository, cloning your fork, working on a separate branch for your changes, pushing your branch to your fork, and then opening a pull request from your fork to the upstream repository. This ensures that your changes are isolated and can be reviewed before being merged into the original project.

It's important to distinguish between the original repository (upstream) and your fork (origin) when working with Git. The upstream repository is the original project being contributed to, while the origin refers to your personal fork on GitHub. Understanding this distinction helps avoid confusion and ensures that your changes are correctly tracked and synced between your fork and the upstream repository.

In summary, cloning is used to obtain a full copy of a repository for local modification, while forking is used to create a personal copy of a repository that can be pushed to and used as a basis for contributing changes to the original project. Mixing up these concepts can lead to issues such as broken remote repositories and pull requests that go nowhere.

Written by urgent.news from HackerNoon's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at hackernoon.com →

More in Tech

A Token Swap Is a Distributed Systems Problem Wearing a Simple UI

TronSeven — Non-Custodial Token Swaps on TRON Network Swap TRC-20 tokens on TRON with self-custody and open-source smart contracts. Low fees, verifiable on TRONSCAN.

  • Token swap is complex distributed systems problem with financial stakes.
  • Users must connect wallet, identify token contract, authorize operation.
  • Model swap as state machine with preparation, quotation, authorization stages.

My Snapchat scraper returned 0 results for a day and still said "SUCCEEDED"

On Monday I checked my Snapchat Spotlight scraper and it looked fine. Green status, run finished in five seconds, exit code 0. The dataset was empty.

  • Snapchat's website layout changed, breaking the scraper
  • Data moved to HTML of pages, streamed as React Server Components
  • User discovered method to extract JSON video data from HTML

More from Tuesday 17 November →