0% found this document useful (0 votes)
2 views

git-introduction

The document provides an overview of Git commands and configuration, including user setup, branching, and merging. It also covers basic terminal commands for Unix-based systems and Windows, as well as text editors and the purpose of a .gitignore file. Additionally, it mentions remote repositories like GitHub and BitBucket, and includes links to further resources such as a Git cheat sheet.

Uploaded by

Anosha Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

git-introduction

The document provides an overview of Git commands and configuration, including user setup, branching, and merging. It also covers basic terminal commands for Unix-based systems and Windows, as well as text editors and the purpose of a .gitignore file. Additionally, it mentions remote repositories like GitHub and BitBucket, and includes links to further resources such as a Git cheat sheet.

Uploaded by

Anosha Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

git developed by Linus Torvalds

https://en.wikipedia.org/wiki/Linus_Torvalds
Some other commands
• git config --global user.name ‘Saqib Ali’
• git config --global user.email ‘ [email protected]
• git branch login
• git checkout login
• git checkout master
• git merge
• git clone
• Avoid entering password – you can use ssh keys
Terminal – Unix based systems
Termina – Unix based systems like Linux or MAC
Basic Commands:
cd – change directory
cd .. Move to previous directory
mkdir – make a directory
ls – to list all files in a directory
ls –all – to list details
touch – to create a file
rm – to remove files or folders
Many more …..
Command line (CMD) - Windows
• dir – to list files or folders in a folder
• cd – change folder
• Many more
Text Editors
• Notepad
• Notepad++
• Atom
• Sublime Text
• vi ( I for insert and to write and quit :wq)
.gitignore - file
• To avoid uploading system, logs and other related files.
Remote Repository
• GitHub – recently purchased by Microsoft
• BitBucket
• Many more…..
How git and GitHub work?
Branching
Basic Commands
Git configuration from the command line:
git help config
git config -h
git config --global user.name 'Saqib Ali'
git config --global user.email '[email protected]'
git config --global init.default branch main

To add all the files in the staging area use


git add .
git status
Basic Commands
# To commit
git commit -m 'Created the network.’

# To create a new branch in git


git branch login
git checkout login

#To merge the changes


git checkout master
git merge login

#To add GitHub remote repository


git remote
git remote add origin https://github.com/saqibutm/Hyperledger-Composer.git
git push -u origin master
https://github.com/saqibutm/go-code.git
Basic Commands
# New repository
Create a new repository on GitHub
On local machine create a folder
cd folder
git init
git remote add origin [email protected]:saqibutm/javascript.git
git pull origin master
add a file
git add .
git commit -m "first commit”

git diff
git push -u origin master
Basic Commands
echo "# abc" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git push -u origin main
Git Cheat Sheet – 50 Git Commands You
Should Know
https://www.freecodecamp.org/news/git-cheat-sheet/

You might also like