Skip to main content

Basic Git Commands and usage with GitHub


This post is a quick reference to the basic git commands and to use GitHub.

  • Get version:   git --version
Starting the process

  • git init (Creating a git repository locally in the project folder)
  • git status (displays the state of the working directory and the staging area)

Configuring global username/email

  • git config --global user.name '<your name>'
  • git config --global user email '<your email>'

Project management

  • git add <filename> (adds a change in the working directory to the staging area)
  • git add *.<filetype> (adds changes in the files with specified filetype)
  • git add . (add all changes in the working directory to the staging area)
  • git rm --cached <filename> (remove a file from git repository)
  • git commit -m "<your message>" (save changes in the local repository)
  • git branch <branch name>  (create a branch)
  • git checkout <branch name> (switch to specified branch)
  • git merge <branch name> (merge specified branch)
Remote project management

  • git remote add <remote name> <https://...> (adding remote repository)
  • git remote (status of remote repositories)
  • git push -u <remote name> <local branch> (push commits in the <local branch> to remote repo.)

If you need a video tutorial please refer to: 





Comments

Popular posts from this blog

Cracking the Black Box: Six Lenses for Understanding Deep Learning

Deep learning has revolutionised technology, giving us everything from uncannily smart chatbots to medical imaging that can spot diseases better than the human eye. Yet, for a long time, a central mystery has haunted the field: why do these enormous models work so well? According to classical statistics, a model with billions of parameters—far more than its training data—should fail spectacularly. It ought to memorise the data, noise and all, and be unable to generalise to new, unseen examples. But deep neural networks defy this wisdom. They generalise brilliantly. How do we explain this apparent magic? There isn't one single answer. Instead, researchers view the problem through several different theoretical "lenses." Here are six of the most important ones. 1. The Linearisation Lens: The Neural Tangent Kernel (NTK) ⚙️ The NTK offers a startling insight: what if, under the right conditions, a massively complex neural network is just a simple, linear model in disguise? The...

Webinar Series on Smart Grid and Microgrids by Smart Grid Research Lab, University of Moratuwa

This webinar series is created by the Smart Grid Research Lab of the University of Moratuwa , Sri Lanka. As a research assistant and a Ph.D. student, I had the honor of organizing the series.  The webinar series is titled "Discussion forum on Smart Grid and Microgrids". It will cover the fundamentals of Smart Grid and Microgrids and the research areas of Smart Grid Research Lab. The webinars will be uploaded to YouTube and created as a playlist . Check out the introduction to the webinar series and the lab by Prof. K. T. M. U. Hemapala.

Definition of a Microgrid

The microgrid is a concept that is modernizing the conventional power system in many countries. It was first proposed in the early 2000s and a lot of research from academia and industry has been conducted to improve the concept as well as the technologies required. Here the definitions of the microgrid are given. USA Department of Energy (DOE) definition (Ton & Smith, 2012): "A group of interconnected loads and distributed energy resources within clearly defined electrical boundaries that acts as a single controllable entity with respect to the grid. A microgrid can connect and disconnect from the grid to enable it to operate in both grid-connected or island mode." European Union (EU) Research Projects definition (Schwaegerl & Tao, 2013): "Microgrids comprise LV distribution systems with distributed energy resources (DER) (microturbines, fuel cells, PV, etc.) together with storage devices (flywheels, energy capacitors, and batteries) and flexible loads. Such syst...