https://github.com/xavierchanth/git-command-cheatsheet
https://github.com/xavierchanth/git-command-cheatsheet
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/xavierchanth/git-command-cheatsheet
- Owner: XavierChanth
- Created: 2020-02-26T22:57:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-26T23:34:15.000Z (over 6 years ago)
- Last Synced: 2025-12-26T05:00:15.720Z (6 months ago)
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Git & Github Workshop
## Install Git
Windows:
> https://git-scm.com/
Linux:
> $ sudo apt install git
Mac:
> $ git
## Create a Github Account
> https://github.com
## Student Upgrade
> https://education.github.com/pack/offers
## Basic Unix Commands
### These work in the following command lines
- Linux
- Windows subsystem for linux (wsl)
- Git Bash (From installing on windows)
- Mac
Make a new directory:
> $ mkdir {directory name}
List the files in the present working directory:
> $ ls
Change the directory:
> $ cd {directory name}
List the present working directory:
> $ pwd
Create a file:
> $ touch {file name}
## Git Commands
Initialize the git repository:
> $ git init
Add a file to the staging area:
> $ git add {file names}
( . will add all files with a change)
(seperate multiple files with spaces)
Commit these files:
> $ git commit -m "{your commit message}":
Clone a repository to the present working directory:
> $ git clone {repository link}
Show the current status of the repository:
> $ git status
## Git Config
git config --global user.name "YOUR GITHUB USERNAME"
git config --global user.email "GITHUB EMAIL"
git config --global credential.helper {$}
> The "$" above can be one of store or cache.
> By default it will not cache or store the password.
## Extras
For working in teams learn:
- git checkout command
- github branches