Skip to main content

Posts

Showing posts from February, 2015

Simple tutorial to work with WSO2 GIT source code for developers

Some important Git commands for branching with remotes and upstream projects First create a fork from an existing repository on wso2 repo https://github.com/wso2 Then create a cloned repository in your local machine from that forked repo. Replace the URL with your own repo URL. git clone https://github.com/chanakaudaya/carbon-mediation.git Now add upstream repositories for your local clones repository.This should be the upstream project which you have forked from. git remote add upstream https://github.com/wso2/carbon-mediation.git You can remove an upstream if you needed. git remote rm upstream Now you can see all the available branches in your git metadata repository. Here you need to keep in mind that only metadata available for all the branches except the master (which is the local branch created by default) git branch -a * master  remotes/origin/HEAD -> origin/master  remotes/origin/master  remotes/origin/release-2.1.3-wso2v1  remote

GIT Cheat Sheet for beginners

CREATE Clone an existing repository $ git clone ssh://user@domain.com/repo.git Create a new local repository $ git init LOCAL CHANGES Changed files in your working directory $ git status Changes to tracked files $ git diff Add all current changes to the next commit $ git add . Add some changes in <file> to the next commit $ git add -p <file> Commit all local changes in tracked files $ git commit -a Commit previously staged changes $ git commit Change the last commit Don‘t amend published commits! $ git commit --amend COMMIT HISTORY Show all commits, starting with newest $ git log Show changes over time for a specific file $ git log -p <file> Who changed what and when in <file> $ git blame <file> BRANCHES & TAGS List all existing branches $ git branch Switch HEAD branch $ git checkout <branch> Create a new branch based on your current HEAD $ git branch <new-branch> Create a new tracking branch based on

Learning GIT from level zero

GIT is one of the heavily used version control systems in the software industry. In this blog post, I am covering the fundamental concepts of GIT vcs for a beginner level user. create a new repository create a new directory, open it and perform a git init to create a new git repository. checkout a repository create a working copy of a local repository by running the command git clone /path/to/repository when using a remote server, your command will be git clone username@host:/path/to/repository workflow your local repository consists of three "trees" maintained by git. the first one is your Working Directory which holds the actual files. the second one is the Index which acts as a staging area and finally the HEAD which points to the last commit you've made. add & commit You can propose changes (add it to the Index) using git add <filename> git add * This is the first step in the basic git workflow. To actua