content_image/763863.jpg content_image/763864.jpg
With the new-app  command you can create applications from source code in a local or remote Git repository. 

The new-app  command creates a build configuration, which itself creates a new application image from your source code. The new-app  command typically also creates a DeploymentConfig  object to deploy the new image, and a service to provide load-balanced access to the deployment running your image. 

OpenShift Container Platform automatically detects whether the pipeline or source build strategy should be used, and in the case of source builds, detects an appropriate language builder image. 

## 2.3.1.1. Local 

To create an application from a Git repository in a local directory: 

$ oc new-app /<path to source code> 

<img src='content_image/763863.jpg'>

## 2.3.1.2. Remote 

To create an application from a remote Git repository: 

$ oc new-app https://github.com/sclorg/cakephp-ex 

To create an application from a private remote Git repository: 

## NOTE 

If you use a local Git repository, the repository must have a remote named origin  that points to a URL that is accessible by the OpenShift Container Platform cluster. If there is no recognized remote, running the new-app  command will create a binary build. 

$ oc new-app https://github.com/youruser/yourprivaterepo --source-secret=yoursecret 

<img src='content_image/763864.jpg'>

## NOTE 

If you use a private remote Git repository, you can use the --source-secret  flag to specify an existing source clone secret that will get injected into your build config to access the repository. 

You can use a subdirectory of your source code repository by specifying a --context-dir  flag. To create an application from a remote Git repository and a context subdirectory: 

$ oc new-app https://github.com/sclorg/s2i-ruby-container.git \ --context-dir=2.0/test/puma-test-app 

Also, when specifying a remote URL, you can specify a Git branch to use by appending # <branch_name>  to the end of the URL: 

$ oc new-app https://github.com/openshift/ruby-hello-world.git#beta4 

## 2.3.1.3. Build strategy detection 

