DevOps-Git/Git Hub-Day'23

git log-

To see all the logs, all commit commands performed for the file/directory.

syn : git log

git log -2 : To see recent 2 commit activities

git log --oneline --graph --all : It shows all the commits in one line

git show : It displays all the activities performed for the file/directory

syn : git show <commit id>

git restore -

If you have made some changes to the commited file and you want to discard those changes you have made use ‘restore’ to discard the changes.

syn : git restore <file store >

git clean -

It removes untracked files in the working area.

git clean -n : To know which file is cleaned.

.gitignore file -

In git repository, it is used to tell git which file/directory are need to be ignored(don’t track and don’t include in version control).

If we use .gitignore file ,the files which we want to ignore are not shown in working area, still they are in our local folders.

READ ME file -

README.md

This is a markdown formatted documentation file, basically it is like a documentation file of your project, added into teh root of the project in git repository.

→ used to guide the others about this project.

git fetch -

Pull the changes happen in remote repository and does’t merge in working stage, does’nt effect the working stage, it moves to local directory.

To see the changed file from local repository to working area we need to merge it by using merge command

git merge

merge conflict -

when developer made changes in remote repository and pulled the code.and another developer made changes to the same line of code in local file, if he want to push that code, merge conflict wil occur we need to solve it manually.

0
Subscribe to my newsletter

Read articles from Sandhya Kalikiri directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sandhya Kalikiri
Sandhya Kalikiri