Git and GitHub

Git and GitHub

July 22, 2021
Git and GitHub

Important commands

git config

git config --global
git config --global
git init
git add -A
git clone
git checkout master
git checkout YOUR_BRANCH_NAME
git status
git add .
git status
git commit -m "commit message"
git checkout YOUR_BRANCH_NAME
git pull origin YOUR_BRANCH_NAME
git push origin YOUR_BRANCH_NAME
git diff 
git remote add first-push-test
git remote add origin
git push origin master 
git mergetool git reflog –all

Git local configuration

git config --local ""
git config --local "User Name"
git config --local credential.helper ""


Checking Your Settings

git config --list

You can fetch all branches from all remotes like this:

git fetch --all

Create a branch in Git from another branch

git checkout -b feature/YOUR_BRANCH_NAME main

How to delete a Git branch locally

git branch --delete YOUR_BRANCH_NAME

How to “pull” from a local branch into another one?

You have to tell Git from where to pull, in this case from the current directory/repository (.):

git pull . master

But when working locally, you can simply use merge (pull internally calls merge):

git merge master


Leave A Comment

Avada Programmer

Hello! We are a group of skilled developers and programmers.

Hello! We are a group of skilled developers and programmers.

We have experience in working with different platforms, systems, and devices to create products that are compatible and accessible.