轉:zend studio使用github

來源:互聯網
上載者:User

標籤:des   http   os   使用   io   strong   for   ar   art   

網上搜到的, 在zend studio 裡面匯入ssh key,這樣就可以直接clone/push/pull github上的項目。

window -> preferences -> general -> Newwork Connection -> SSH2 -> Key Management

在這裡你可以產生或匯入key, 在eclipse 裡面也可以用。

下面原文:

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 should 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 could 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 (should 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 should 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 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.

轉:zend studio使用github

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.