Go to Zend studio using GitHub

Source: Internet
Author: User
Tags how to use git zend framework

If you find it online, import the SSH key in Zend studio so that you can directly clone/push/pull GitHub projects.

Window-> preferences-> General-> newwork connection-> SSH2-> Key Management

Here you can generate or import keys, which can also be used in eclipse.

The original Article below:

Hy fellows,

In one of my last posts I described how to use git under windows.

Now as Zend released Zend Studio 8 and ZF migrates to git with the next major release it's time so see how those can be matched to work together. note that this is not fixed to Windows but shoshould work regardless of the Use OS in any environment.

Prerequisits
What do you need to start?

I assume that you already have a working GitHub repository asdescribed In the last post.
Then you need a installed version of Zend Studio 8 or newer.

Installing git
Now you need to make your Zend studio aware of git. therefor weneed to install egit. egit is a module for eclipse which makes zendstudio (which is based on Eclipse) Understand git and providesseveral tools for working with git.

  • To install egit open Zend Studio
  • Click "help"
  • Click "install new software ..."
  • Click "Add ..."
  • Enter "egit" as "name"
  • Enter "http://download.eclipse.org/egit/updates" as" location"
  • Select all modules by clicking "select all" (you cocould omit thetwo moduls only containing "source" if wished)
  • Click "Next" until you see the license agreements
  • Click "agree" on all license agreements (of course read theagreements before you agree)
  • At last click "Finish"

Now egit will be installed within Zend studio. As last step youwill need to restart Zend Studio (if it is not doneautomatically ).

Security preparations

When you already used git you will know that it needs RSA keys. So our next step is to make new keys which will be used within zendstudio to commit to GitHub.

  • Open Zend Studio
  • Click "window"
  • Click "preferences"
  • Expand "general"
  • Expand "Network Connections"
  • Open "SSH2"
  • Go to the tab "key management"

Now you can eighter use an existing key or add a new one.

To load an existing key:

  • Click "load existing key ..."
  • Within the Explorer window go to the directory where you storedthe existing key for GitHub and select it
  • Enter the "passphrase" when your key needs a passphrase
  • Confirm the "passphrase" when your key needs a passprase
  • Click "OK"

It is preferred to make a new key instead of loading an existingone. therefor:

  • Click "generate RSA key ..."
  • Leave the passphrase empty (This simplifies the laterhandling)
  • Click "save private key ..."
  • Click "OK" to confirm that you want no passphrase
  • Within the Explorer window go to the directory where you wantto store your keys
  • Click "OK"
  • Click "OK" once more
  • Open GitHub within your Internet browser and login to youraccount
  • Click "account settings ..."
  • Click "Public SSH keys ..."
  • Click "add another public key ..."
  • Enter "Zend Studio" as title
  • Copy the public key which you can see within Zend studio as keyinto GitHub
  • Click "add key ..."

At last, regardless is you added an existing or created a newkey, click "OK" within Zend studio to close the preferences windowand Save the settings. you have successfully prepared Zend studioto be used with your GitHub account.

Connecting to GitHub

The next step is to connect our GitHub account to zendstudio.

  • Open Zend Studio
  • Click "file"
  • Click "Import ..."
  • Now expand "Git"
  • Select "projects from git"
  • Click "Next"
  • Click "clone ..."
  • Open a Internet browser and login to your GitHub account
  • Click your zf2 Repository
  • Click "HTTP" (it is near SSH, HTTP ...)
  • Copy the link which is shown (shocould look like "https: // [email protected]…" Into your clipboard
  • Copy the link from your clipboard into "Uri" within the openedzend studio Tab
  • Enter your GitHub password within "password"
  • Click "Next"
  • Click "Next" once more to add all branches
  • Enter the Directory into "directory" where you want to storethe local repo (this shocould be an empty/new directory)
  • Click "finish"

This step will take several minutes as it now copies your remoterepository to your local drive.
We're re done. You have successfully connected your git repositorywith Zend studio.

You can now do your complete work from within Zend studio. itsupports all needed tools. Some of these tasks I will describenow:

Create a new branch

To create a new branch do the following:

  • Right-click your project
  • Click "team"
  • And then click "Branch ..."
  • Click "new branch ..."
  • Enter the name of the new branch to "branch name ..."
  • Select "rebase" (with "NONE" you will not be able to commityour changes to your GitHub account)
  • Click "finish"

Now you're working within a new created branch.
Keep in mind to use the proper naming convention.
"Hotfix/zfxxxx" for quick fixes and "feature/xxxx" for newfeatures. Always use "zfxxxx" when there is a related issue withinjira.

Committing changes

Committing your changes is also quite simple:

  • Right-click your project
  • Click "team"
  • Click "commit"
  • Enter a note about what you're committing within "commitmessage ..."

I always use notes like this:

[feature/MyFeature] - changed something - another change
  • Select the files which you want to commit
  • Click "finish"

Now your change is stored in your local repository. To send your changes to your GitHub repository you need to do the following:

  • Right-click your project
  • Click "team"
  • Click "push to upstream"
  • Click "OK"

At last your changes are also available within your GitHub repository.
To have your change integrated within zf2 you need to make a "Pull-request" from your GitHub repository.

The above description does not only work for Zend framework butcan also be used for other projects.
I hope you find this post interesting so I wish you a good work andhave fun with git.

Go to Zend studio using GitHub

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.