How to download GitBash on your computer.
-Visit Git Bash
-Download the Windows installer
-Run the installer with these recommended settings:
-Select "Use Git from Git Bash only "
-Choose "Use the OpenSSL library"
- Select "Checkout Windows-style, commit Unix-style line endings"
-Choose "Use MinTTY"
-Leave other options as default
For Mac Users:
- Install Homebrew (if not installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Git:
brew install git
- Verify:
git --version
How to push codes on git bash
- When one whant's to check the version he/she is using
git --version
- When you need help
git help
- If you want to create a repository we use th command,
git init
while for existing repository we use
git clone <url>
- When you want to configure your name we use the following commands.
git config --global user.name "Your Name"
git config --list (*when you want to list your configutration*)
- How to create ssh key we use
ls ~/.ssh
- When you want to make ssh key we use
ssh-keygen -t ed25519 -c (*followed with your email address*)
- When you want to create ssh agent we use
eval"$(ssh-agent -s)
- When you want to create a folder in git bash
mkdir (your folder name)
- When you want to get into the folder you have create we use
mkdir cd
- If you want touch a file in the existing folder
touch (folowed by file name)
- if you want to make branches on git bash
git branch # List branches
git branch new-branch # Create branch
git checkout new-branch # Switch branch
git checkout -b new-one # Create & switch
git merge branch-name # Merge branch
- when you want to Undo / Fix Mistakes on GitBash
git restore file.txt
git reset HEAD file.txt
git reset --hard
- When you want to save you work temporarily on GitBash we use
git stash
git stash list
git stash po
- When you want to view your past history we use the following commands
git log
git log --oneline
git diff
- Connecting git bash to git hub we use
ssh .T git@github.com
Top comments (0)