GitHub Commands ..

Techno Freak
2 min readJun 19, 2022

The Version Control

The provider of internet hosting for version control using git and Software Development .

Few Commands to get going ..

git help : Take help from GitHub section for different errors and commands.

git config: Set the basic configuration on GitHub(modifying your username email). eg : git config — global user.name “Techno Freak”

git init : create a local git repository for us in our store folder. Acts like a manager to the git commands for that particular repository.

git status: Helps to see what changed since the last commit.All the history of the repo will be given by this command.

git add Readme.txt : Add readme file to the staging area to track its changes.

git commit -m “Uploaded a file” :Commit our changes and providing message to remember for future reference.

git log : History of commands for our reference.

git add : add a specified list of files to staging area.

git add -all : add all files of the current directory to staging area.

git reset head license : to undo the staging of file that was added in the staging area.

git diff : used to checkout what was the last change made since last commit.

git reset -soft HEAD^ : to undo last commit and bring file to staging area.

git remote add origin https://github.com/technofreak/codes : This command makes a bookmark which signifies this particular remote refers to this URL. The above remote will be used to pull any content from the directory and push local content to the global server.

git remove rm: Remove a remote from our local repo.

git clone https://github.com/technofreak/codes.git : make a copy (clone) of the global repository in your system.

Note: git clone command will download the repo and creates a remote named as origin which can be seen by the command git remote -v.

git branch Modification : Used to create a new branch name called Modification.

git branch : to see all the branches.

git checkout Modification : Switch to branch Modification from master branch.

git merge Modification : To merge Modification with master branch.

git branch -d Modification : to delete branch Modification

Some extras of git branch

: git branch -r : To look at all the remote branches.

:git branch -D Modification : Forcefully delete a branch.

git fetch : to fetch any changes from global repo to current repo

git rebase : 3 important tasks are performed by git rebase

1. Run all origin master commits.

2. Run all commits in the temporary area on top of our master one at a time ,so it avoids merge commits.

3. Move all changes to master which are not in origin/master to a temporary area

Checkout the commands and do subscribe the writing for such content…

--

--

Techno Freak

Devops &Full-Stack enthusiast . Helping People to learn about cloud and opensource . Learning bit by bit