Skip to main content

Github Tutorial

  • GitHub brings together the world's largest community of developers to discover, share, and build better software.
  • Delivered through software as a service(SAAS) business model
  • 2008 by linus (Owner: Microsoft) 

#Create New Repository in Github

  1. New Repository
  2. Add Repository Name and description
  3. Public / Private, initialize this repo with Read Me
  4. Create repository

create a new repository on the command line

echo "#test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/sinuna/test.gitgit push -u origin master

…or push an existing repository from the command line

git remote add origin https://github.com/sinuna/firstRepository.gitgit push -u origin master

…or import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.

Initialize Repo

$ git init

Clone Repo

$ git clone https://github.com/<username>/test.git 

 Repositories (remotes) whose branches you track
$ git remote -v

Push files in Github

git clone https://github.com/sinuna/test.git
git add .
git commit -am file_name or folder_name
git push origin master

Delete

$ git rm -r file_name

Branching

$ git switch -c <new-branch-name>

$ git branch
  develop
  feature_x
  master

$ git switch master
$ git switch develop
$ git switch feature_x
$ git config --global alias.sw 'switch'
$ git sw master

git log(shows previous commit)

Check status

$ git status

Merging

Nonetheless, here's how you merge-in changes from origin's feature_x branch:

$ git fetch origin
$ git merge origin/feature_x

Pulling

Pulling is just doing a fetch followed by a merge.
$ git pull origin/feature_x

Deleting Branches

Delete a local branch:
Use the -D option flag to force it.


$ git branch -d <local_branch>



   branch.     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   merge      Join two or more development histories together
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

Git: working with branches
1. Git branch (show all the branches including orgin)
2. Git branch develop (creating new branch "develop")
3. git checkout develop (go to "develop" branch)
4. Git status (showing the any commit changes)
5. git commit -am "adding something new"
6. git log (you can see no. of commit you have made)
7. git checkout master
8. git checkout develop
8. git checkout -b feature/newFeature (new way of creating branch) (this will be going to reference of the develop branch and create a new branch based on the develop branch)





GIT: Merging and Workflow

1. git branch
2. git checkout feature/new-feature
3. git checkout develop
4. git merge feature/new-feature
5. git log
6. git commit commit_id



Master branch -> Production branch
Develop branch -> developing stages

# mlab
- is the largest cloud MongoDB service in the world, hosting over a half million deployments on AWS, Azure and Google.
- is leading DB-as-a-servie for MongoDB, powering a million deployments worldwide.

Comments

Popular posts from this blog

Javascript: Object to Array and Array to Object

Output: Final Array [ { mango: 1 }, { apple: 2 }, { banana: 3 }, { orange: 1 }, { watermelon: 1 }, { papaya: 1 } ] Output: Final Object { mango: 1, apple: 2, banana: 3, orange: 1, watermelon: 1, papaya: 1 }

Javascript: Callback and High Order Function

CALLBACK A callback is a function that gets invoked after an asynchronous result appears. a callback function is an async function argument. - Asynchronous code result handle using callback and promises. // callback  function function with argument  // ---argument :// if a function pass-through function as an argument, it is higher-order function. function needs to be called in order to execute. a callback is used when calling a function asynchronous  What is a Callback or Higher-order Function? A callback function , also known as a higher-order function, is a function that is passed to another function (let’s call this other function “otherFunction”) as a parameter, and the callback function is called (or executed) inside the otherFunction. A callback function is essentially a pattern (an established solution to a common problem), and therefore, the use of a callback function is also known as a callback pattern. High-order function is a function that takes ...

Javascript: Frontend - AngularJS

# FrontEnd Technologies: # Web (Internet) - Html, css framework (bootstrap, material design-> component based) Angular 2 - Single page application (fast). - Web application or website that interacts with the user by dynamically rewritting the current page rather than loading entire new pages from a server. - Can do asynchronous jobs. # Tools: - Typescript - VS code # MVVW (Model View ViewModel Pattern) -> two-way data binding - In angular, the controller (the C in MVC) is replaced by ViewModel (the VM in MVVM). # Typescript Programming Language Typescript (.ts) is imp in angular 2. - supersetup js - strictly typed program - can do class based oop - future programming language. - security maintain (TS code compile and run in js) - JS with additional features. # Data Binding - Controller and Views synchronize. Types: 1. Event -  eg: click, onClick, change 2. Property - eg: hide, show 3. 2-way binding - Reflect in view if changes in model- c...