Integration with Git, GitHub.
In this blog, we learn about the basics of Git and GitHub .
Git:-
Git tool is used to create a local repository or workspace and store it anywhere. Git provides the same operation like, initialize the Git, add the files, push the file on the GitHub, merge the file, etc.
Download the git:-
sudo apt-get install git
This command is used to install the Git on the Ubuntu 18.04.
Create a directory:
In this module create a directory, and create a file.
mkdir hello
cd hello
cat
cat > index.html
Cat command is used in Linux to create a file and write data on the file.
uses this command to create a web page, and write data on the page.
cat >> index.html
This command is used to update the data on a web page or file.
cat index.html
This command shows the text in the file.
Git add .
This command adds all the files in the local area or repository.
Git status
This command shows the status of Git. This command shows one file added to the local repository.
Git status -s
This command shows one file in the added mod. If you want to modify the file then go through the same process. write something on the file, add the file, show the status on the file.
Git commit -m “first commit”
This command is used to all the previous work stable, not any addition occurs on the text file then commit with some comment, the comment shows what we do first commit.
Github
Github source control management tools. Github is used to manage the code and share the code. On GitHub, push the code and download the code and share it with anyone publicly, download the and use it.
step 1:- Create an account on GitHub.
Step 2:- Create a repository on Github.
Integration Git and GitHub:-
In this module, upload the local repository on GitHub using Git commands.
git remote add origin <repository HTTP link>
Attach the repository to the locale repository.
git push -u origin master
This command asks about GitHub id and password, fill in the password and id and upload the repository.