Skip to main content

Github - Basic commands

Github - Basic commands


The windows portable git will work in most cases when you are working on Windows OS. Initiate the git in the current folder. Right click and open the git bash. 

Opening the git client

If on command line, git init should work.

git init

Cloning the entire remote repo to a local location with root folder name as the repo name.


git clone https://github.com/rapidsailor/ShellScripts

Now navigate to the the newly created folders. Use cd command as needed. Make some code changes. 

To verify the changes and status


git status

Add any new files to the repo or add the changes to existing files.


git add

Commit the changes

Commits all the changes to the remote repo. This may ask for your github user and password.

git commit -m “comment for check-in”

Note : Any file changes to be done using the vi, ( i for insert mode, put in some comments. All the lines starting with # will be ignored. put some new lines without # as starting char.) esc for going to command mode. :wq for saving and exiting and :q! for not saving.

Push the changes to remote master branch.


git push origin master (this will push the data to the master branch of the remote repo)

Pull the latest from the remote location.


git pull (Run this in the project folder)

Branching out and creating new branches.


View all the current branches


git branch

Create new branch. Below command will checkout the original code to new branch called branch1. 

#git checkout -b branch1 (-b is used to create a new branch. To switch to an existing branch, remove -b) After any code changes , run the following.
 

Basic steps during a standard session


git add

git commit -m “comment for check-in”

git push -u origin branch1.


Setting the git configs


git config –global user.name “your full name”

git config –global user.email “your email”

Comments

Popular posts from this blog

Viewing visio files using draw.io

 Viewing visio files using draw.io. If you do not have Microsoft visio installed on your windows machine, you still can open and view visio diagram files. We can make use of draw.io . The draw.io web app does not support viewing the visio files. You can download the draw.io windows app from their website. You can visit https://www.drawio.com/ and download the application. Once you install it , you can import a visio file into it like any other diagram/image file. I hope this info is helpful in some situations.

Termux - The android Terminal

Termux No hesitation, you can certainly call Termux “The Android terminal”. Owing to it’s simplicity and capabilities, Termux stand so close to the original Linux terminal. Who is it for and who should read this? This is beginner article which will introduce you to the fundamentals of using Linux terminal on android devices. To understand something here, you should barely understand English and nothing else is a pre-requisite. 🤓 Let us figure out the basics.   Android If you are using an android device, you know that android is the operating system that run the show on your mobile phone. Android is an operating system with its core based on Linux. In fact, android is based on a modified version of Linux optimized for mobile devices. Terminal Terminal is a command line interface which can be used to communicate with or control the Operating system. So, a linux terminal can be used to control a Linux device. Terminal is a tool that comes default with a full fat Unix or Linux opra...

CR-2032 Batteries- Where are they used

 Batteries, CR2032. What is CR2032 (also written CR-2032)? CR2032 is a non rechargeable 3V lithium battery which is used in many electronic devices. It resembles a coin and hence it is also called a coin cell or coin battery.  A Panasonic CR2032 cell What are it's main applications and lifetime in each cases? 1. Car keyfobs . (Lifetime - Normally works for several years, 3-8 years) 2. Apple Airtag. (Lifetime - 1 to 1.5 years) 3. Temperature and humidity sensors. (Around 1-2 years) 4. Toys.(Will run out very soon 😜) 5. Smart home sensors. 6. Calculators. 7. Remote controls for garages etc.