Use Git and Github from terminal Skip to main content

Use Git and Github from terminal

GIT is a online version control system for tracking the changes in files and collaborative development of project among multiple people.

Installation:

Windows users should download the git setup from here.You can opt to use Git from Windows command prompt or use Git bash insted.

For Linux Users:

Debain or Debain based distribution should run following command from terminal:

sudo apt-get install git

Arch Linux or Arch Linux based distribution users :

sudo pacman -S git

Once installation is done open up the Linux terminal or windows cmd/bash terminal.

Run the following command one by one, enter your own Github username and email id in double quotes.

git config --global user.name "user_name"
git config --global user.email "email_id"

Now create a local repository on your system using the command:

git init MyRepo

Now create a files in your repo:

cd MyRepo
vim README
This is my first repository on github.
save this file.

A file named README is generally used to define what the repository actually contains.

Now you can create other files you want.
EG: You have craeted a file named sample.py .

Now run following commands in terminal:

git add README
git add sample.py
You can also add all the files in directory using:
git add --all

Now we can commit the changes made to the files by using the command:

git commit -m "some_message"

Now create a repo on your Github account named MyRepo.

Now run following coammand in terminal.

git remote add origin https://github.com/user_name/MyRepo.git

Now we have to push files in local repository to Github repository.For this use the given command:

git push origin master

Now enter your login credentials as prompted.Make sure your system is connected to internet.If you have followed everything correctly then your repo will be uploaded on Github.

The result will be somewhat like this.

Comments

Popular posts from this blog

What is schedutil in Linux Kernel?

The schedutil is a fairly new cpu frequency governor found in Linux Kernel . This CPU governor controls how the CPU raises and lowers its frequency according to the demand. Shadeutil was introduced in linux kernel version 4.7 as an alternative of ondemand and performance. This is special because it makes the use of cpu scheduler utilization data . Load estimation is achieved through the scheduler's Per-Entity Load Tracking (PELT) mechanism, which also provides information about the recent load. The schedutil cpu frequency governor aims at better integration with the Linux kernel scheduler. This governor currently does load based Dynamic voltage and frequency scaling (DVFS).only for tasks managed by Completely Fair Scheduler(CFS(*CFS is a default scheduler. It handles CPU resource allocation for executing processes, and aims to maximize overall CPU utilization while also maximizing interactive performance. )). RT(Reaction Time) and DL (Deadline task) scheduler tasks are...

[Solved]High CPU usage by systemd-journald process

The systemd-journald is service in Linux OS that collects and stores the logging data. On some Linux distributions it is often found that systemd-journald service is consuming more than 90% or some times nearly 100% of CPU resources. So here's a fix for this problem... Open your terminal and type following command.(You can use text editor of your choice.) sudo vi /etc/default/grub Find a the line that begins with GRUB_CMDLINE_LINUX_DEFAULT=" " There will be some parameters inside double quotation mark. Add this parameter there... pci=nomsi And save this file. Now run following command in terminal... sudo update-grub This will take little time to complete. After this reboot the system and your problem is Solved! You can check the usage of all processes in system monitor or htop program.