GitHub is like a website where people who write computer code can put their work. It helps them save and organize their code, and it has tools to work together with others, review each other’s code, and manage projects. It’s a handy place for developers to keep track of changes and work on software together.
Configuring git for the first time ?
$git config global user.name “<Enter your username here>”
$ git config global user.email “<Enter yourn email here>”
General Git Features :-
Initializing Git :- $ git init
Git now knows that it should watch the folder you initiated it on. Git creates a hidden folder to keep track of changes.
Staged files are files that are ready to be committed to the repository you are working on.
When you first add files to an empty repository, they are all untracked. To get Git to track them, you need to stage them, or add them to the staging environment.
Staging all files in a folder :-
$ git add all aur git add -A
Making a Commit :-
Adding commits keep track of our progress and changes as we work. Git considers each commit change point or “save point”. It is a point in the project you can go back to if you find a bug, or want to make a change. When we commit, we should always include a message.
$ git commit m “<Enter your message here>”
Git Commit without Stage :-
Sometimes, when you make small changes, using the staging environment seems like a waste of time. It is possible to commit changes directly, skipping the staging environment.
$ git commit a m ““<Enter your message here>”
Status of files and log:-
$ git status
File status in a more compact way:-
$ git status short
Log of a file :- Log is used to view the history of commits for a repo.
$ git log
$ git log oneline