You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A humble attempt to create a easy on the eye, skimable git cheat sheet. Please comment with requests, improvement suggestions or corrections.
## Starting a Repo init/clone/remote
**Create or Initialize** a repo from **existing** code or files
> git init
**Clone** a current repo (into a folder with same name as repo)
> git clone (repo_url)
**Clone** a repo into a **specific folder** name
> git clone (repo_url) (folder_name)
**Clone** a repo into **current directory** (should be an **empty directory**)
> git clone (repo_url) .
**Create** a remote repo **named origin**
pointing at your Github repo (after you've already created the repo on Github) (used if you git init since the repo you created locally isn't linked to a remote repo yet)
**Merge** a specific **branch** into the **current** branch.
> git merge (branch_name)
Take **all the changes** in one branch and **replay** them on another **branch**. Usually used in a feature branch. Rebase the master to the feature branch so you are testing your feature on the latest main code base. Then merge to the master.
> git rebase (branch_name)
**Merge/Cherry Pick** one specific **commit** from another **branch** to your **current** branch.