Skip to main content

Git Commands

Start with Git

Git Commands and Their Explanations

Git CommandDescription
git initInitialize a New Git Repository
git add .Add Files to the Repository
git commit -m "Initial commit"Commit Changes
git remote add origin #repository_URL#Link to a Remote Repository
git push -u origin masterPush Changes to GitHub

Branching and Merging

Git CommandDescription
git checkout -b #branch_name#Create and Switch to a New Branch
git checkout #branch_name#Switch to an Existing Branch
git merge #source_branch#Merge Changes from Another Branch
warning

Create always a new working branch