Sitemap
0x0Aleem

0x0Aleem

DFIR Analyst

Git&GitHub Commands

2 min readSep 25, 2023

--

First of all, we make a username and user mail on the Git Bash

The username command

git config — global user.name “ Here right your username you like”

The user mail command

git config — global user.mail “ Here right your user mail you like “

— — — —

IF you want to check if they been added or not

git config user.mail

git config user.name

— — — —

Then we make a new repository

git init “write the name of your project”

— — — —

After making a repository you have to move in it

cd writes the name of the directory

— — — —

Then we create the file which we will work with in the project in our IDE environment

touch

example: touch index.html index2.css

— — — —

To know the status of our project so far we can use the below command

git status

— — — —

After making a file it will be in a status of untracked so we must put it in what we call a stage

git add

— — — —

After the files is in the stage area we must put it in the repository and with a massage to keep recording the logs

git commit –m” write your massage”

Get 0x0Aleem’s stories in your inbox

Join Medium for free to get updates from this writer.

— — — —

To know your logs

git log

— — — —

If you want to go back to any previous update

git checkout (and write the hash of the commit you want to go back)

— — — —

If you want to know the main and other branches.

git branch

— — — —

Create new branch

git branch (write your branch version)

— — — —

To move to deferent branch

git checkout (write your branch version)

— — — —

To merge the updates you make from different branch

git merge (write the branch version you want to merge)

— — — — — — — — — -

In this area we will need to add our local repository to the remote repository (GitHub)

To check if we have any connect local to remote repository

git remote –v

— — — —

You need to go to your page on GitHub and make your project, then take the HTTPS Clone and go to your Git Bash and write it

git remote add origin (write your HTTPS Clone)

— — — —

So far we only make a connect from our local to the remote now we need to push our project to our profile GitHub

git push -u origin master

— — — —

If any collaborators make changes and you want to take the change from the remote to your local

git pull origin master

--

--