Fundamentals 10 min read

Master Git and GitHub: From History to Hands‑On Setup and Collaboration

This guide explores the origins of Git, the birth of GitHub, and provides step‑by‑step instructions for installing Git on various platforms, configuring user settings, linking local repositories to remote GitHub repos, and collaborating through forks, pull requests, and IDE integration.

Java Backend Technology
Java Backend Technology
Java Backend Technology
Master Git and GitHub: From History to Hands‑On Setup and Collaboration

Git and GitHub History

Git was created by Linus Torvalds in 2005 as a distributed version‑control system after the community lost access to the commercial BitKeeper tool. Within a month Git took over the Linux kernel source management, and in 2008 GitHub launched to host remote repositories, fostering strong open‑source communities.

Why Use Git and GitHub

Git enables version management, collaborative editing, file‑state tracking, permission control, branch management, and distributed repositories that improve efficiency, safety, and flexibility for developers.

Installing Git

CentOS

sudo yum install git-all
git --version

Ubuntu sudo apt-get install git Windows

Download from git-scm.com .

Configure Git

git config --global user.name "guangguang"
git config --global user.email "[email protected]"
git config --global merge.tool "kdiff3"
git config --global core.autocrlf false
# Encode settings
git config --global gui.encoding utf-8
git config --global core.quotePath off
# Windows case handling
git config --global core.ignorecase false

Generate SSH Key

ssh-keygen -t rsa -C "[email protected]"
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub

Copy the public key to GitHub → Settings → SSH keys.

Link Local Repository to GitHub

git remote add origin https://github.com/qqdb/example01.git
Replace the URL with your repository address.
git push -u origin master

Subsequent pushes use git push origin master. Force push ( git push -f origin master) should be avoided after the first push.

Clone a Repository

Use git clone https://github.com/owner/repo.git in your IDE (e.g., PyCharm) or command line.

Fork and Contribute

Click “Fork” on a GitHub project to create your own copy. Clone the forked repo, make changes, commit, and push. Open a pull request on the original repository, where maintainers can review and merge your changes.

Typical Git Operations in IDE

IDE integration (e.g., PyCharm, IntelliJ IDEA) provides UI for committing, pushing, pulling, branching, and handling merge conflicts, streamlining the workflow described above.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

IDE integrationGitcommand-lineTutorialGitHubVersion ControlCollaboration
Java Backend Technology
Written by

Java Backend Technology

Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.