Git is a very wonderful and revision management system as we all developer know it. Git has itself an advance level bus architecture. Today Git is very useful for every IT industries they are using it very frequently. But still Git has hold many hidden features, which we have not know yet. So today I am going to share one of them.
It is Upstream and Downstream. Before trying to understand what the upstream tracking branch is, you need to be familiar with remote branches (e.g. origin/master). If you are not, you probably want to read the section about them in the Pro Git book here.
To see all your remote tracking branches, you can use
git branch –remotes
The upstream tracking branch
Even if you have never heard of the concept, you probably already have at least one upstream tracking branch: master -> origin/master. When you clone a repository the current HEAD (usually ‘master’) is checked out for you, but also, it’s setup to track ‘origin/master’, and thus ‘origin/master’ is the “upstream” of ‘master’.
This has some implications on some Git tools, for example, when you run ‘git status‘ you might see a message like this:
# Your branch is behind 'origin/master' by 1 commit.
This is useful in order to keep your local branches synchronized with the remote ones, but it’s only scratching the surface.
Problem
A downstream repository (aka a “fork”) maintainer commonly needs to stay current with upstream work. The following steps allow you to achieve this on the command line in a local git repository.
Steps
Add the Remote Upstream Repository
This step defines the upstream repository of your fork.
$ git remote add upstream [Upstream git URL]
Fetch the Upstream Branches
$ git fetch upstream
Merge Upstream Changes into your Downstream Repository
From your master branch, use the following merge command to merge the upstream master branch changes into your local source:
$ git merge upstream/master
Create a New Branch for Work
Create a branch off of the master branch that will include the new work. While working in the master branch, execute the following (with any appropriate branch name in quotes):
$ git checkout -b "feature-new-stuff"
Here, we defined the branch feature-new-stuff and will perform work there.
Perform Your Local Work
Follow the standard local repository workflow of file changes with git add . git commit steps for the files.
Push Changes to Your Downstream Remote Repository
When you are ready to push changes to your remote fork of the upstream repository, use the following:
$ git push origin feature-new-stuff
Your local and remote downstream repositories are now current with your local feature-new-stuff changes and this branch is current with the upstream repository changes as of the time of the merge step above.
Here I have picked one of most interesting topic for API development. From many year, we are developing an API in two Protocols REST and SOAP and most of time developers are preferred REST, because of its simplicity and easy to handle in APPS'. But last many days I have seen a new Query language with more simple and fast as compared to REST and it is graphical query lang.(GraphQL).Intro...
After a long time i'm going to write a tut for you. Today i am just trying to explain you how you can build your web application using Yii2 PHP framework. We know that Yii2 is stand for 'Yes it is', by the help of this framework developer can build his/her web ap...
A loop is concept of repeating until not false the condition. JavaScript has several loops with different conditions, these are followingfor loop
while loop
do while
for inBasically you can use any loop in your program , but each has some con...
Function is very important , because it reduces the program length . Function is a complete bunch of instructions . In javascript some predefined function are also available for your help, in this post i explain you how to declare function in javascript and also so...