Learn Git and host your website- Day 3
Github
- Create a Github account
- It helps you to share you code multiple computers or collaborate with friends
- version control system
Install Git
=======
- download git from Google
- git --version
- download Github desktop https://desktop.github.com/
Configuring Git
===========
- git config --global user.name "coderMojnu"
- git config --global user.email mojnu.cse.pust@gmail.com
First Push
=======
- mkdir first_push
- cd first_push
- touch README.md (Markdown is a language that looks a lot like plain text)
- echo "foo bar bizz bang" >> README.md (saving some text in README.md)
- cd projects/first_push/
- git init
- git status
- git add README.md (Calling git track the file)
- git commit -m "Initial Commit" (Calling git to save this)
Checking Status and Branches
======================
- git status
Send your all Code to github
=====================
- create a new Repository and fill up the information and hit 'create Repository' button
git remote add origin https://github.com/coderMojnu/awesome.git
A remote is a copy of your local repository, You can push changes to a remote or pull changes from a remote.
- git push origin master
Every time follow this 3 instruction to send your code on github
===============================================
1. git add . //calling git track the file
2. git commit -m "Your Commit - Added a header" //calling git save this
3. git push
Git pull
======
- git pull
create a folder by command line
=======================
- e:
- cd folderName
- mkdir newFolderName
delete a folder
==========
- rmdir FolderName
create a file by command
==================
- touch testfile.md
delete a file
========
- rm testfile.md
move files and copy files by command
=================
- cp fileName f:/folderName/folderName
- mv
- cp fileName f:/folderName/folderName
memorise the command below:
=======================
- pwd
- ls
- cd
- mkdir
- rmdir
- cp
- mv
- touch
- rm
Git Cheatsheet
===========
Host your website by Github pages
==========================
Resources: Set up git - https://docs.github.com/en/get-started/quickstart/set-up-git
Comments
Post a Comment