-
Clone the repository:.
git clone “URL”. Change cd to “repository name”. -
Create the five files.
Create the files by using = touch “filename.txt, py, html, css, json, xml. Add the data by using = vi “filename” -> click the I -> add data, edit the data --> click the ESC -> enter :wq! -> click enter btn. -
Tracking the files.
Check the status by using = git status. If file is untracked = git add “file name”. -
Restore.
Restore is used to return the file from the stagging area to the working area (stagging area -> working area). git restore --staged “filename”. After we edit or add data to that file and then perform -> git add “file name”. -
Commit the changes.
Commit the changes by using = git commit -m “msg” -> for new files. = git commit -am “msg” -> for old files. -
Push the files from local to remote.
Push the file by using = git push -u origin “branch name”. = git push -> shortcut command. -
Add the additional data to the files, which we created previously.
Add data by using = vi “file name” -> for editing and adding data. = cat >>”file name” -> for adding data only. -
git commit -am “msg”:
Instead of performing git add and git commit separately, we perform it in single command = git commit -am “msg”. -
Git amend:
Git amend is used to re-edit the commit msg. o git commit - -amend “msg” -> for latest commit. o git commit - - amend -m “commit id” “msg” -> for specific command. -
Revert :
Add the data to the files that we created previously for more commit ids, (a minimum of 3 commits is required for better understanding). o git revert “commit id” “commit id” (latest commit id -> oldest commit id). o After performing revert, editor is opened -> click insert -> change the commit-msg -> click ESC -> enter “:wq!”. o Once the revert is completed, check whether the data is deleted or not. -
Push:
The purpose of the push is to update changes that ever we did in locally in the remote repository. git push -u origin “branch name”. -
Create a new Branch:
git branch -> for list out the branches. git branch “branch name” -> for creating new branch. git switch “branch name” -> for switching branch. (or) git checkout “branch name”. -
Again perform everything like creating the file, adding data, committing, pushing, revert, and restore.
-
Merge:
Merge is used to combine data from one branch to another branch. Merge test branch with master branch. git merge “branch name”. -
Tag:
A tag in GitHub is a label used to mark a specific point in a repository’s history, like a version or milestone. git tag -a “annotation (or) alias” -m “msg” -> for creating a tag git tag -> for list out the tags. git push -> we have to push files and tags individually. git push --tags -> for pushing tag to remote repository.
reddi122/reddaiahAT1059
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|