Create a folder with 3 files and Push them to GitHub
ฝัง
- เผยแพร่เมื่อ 14 พ.ค. 2024
- Create a folder with 3 files and push them to Github.
First we create an EC2 instance and with instance we can install git and follows:
Steps:-
For Git installation on Amazon Linux/Fedora/Cent-OS/RedHat..
$ sudo yum install yum-utils
$ sudo yum update
$ sudo yum install git
For git installation on Ubuntu OS..
$ sudo su-
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:git-core/ppa -Y
$ sudo apt-get update
$ sudo apt-get install git -Y
For checking the version we can use..,
$ git --version
To create a new folder ------= $ mkdir Git-demo
To view the list we can use -------= $ ls
Put the 3 files in the folder.. So that we go to that created directory as
$ cd Git-demo/
touch code.txt log.txt output.txt
Stage the code and output files as-------= $ git init
$ git add code.txt output.txt
$ git status
Commit them as
$ git commit -m "output and code"
finally PUSH them to Github as
$ echo "Git-demo-Git" READ.md
$ git init
$ git add READ.md
$ git commit -m "first commit"
$ git branch -M main
$ git remote add origin github.com/Roja060/git-demo.git
$ git push -u origin main
Give username and password as generated in Github personal access tokens.