GitHub Plugin Setup On Anypoint Studio
GitHub Plugin Setup On Anypoint Studio
Author
Sudha CH
Page no: 1
ABSTRACT
I would like to provide you a complete overview on installation steps of GitHub.
I have provided the information from scratch to cloning of the existing projects
available in the GitHub. Please go through the detailed steps mentioned below
which would make the installation, saving a project, creating a repository,
committing and pushing changes to the repository etc This would make your life
easy by following the steps.
Please do comment on our blog, if you have any suggestion related to the book,
I would like to know more about the recommendation from users for our further
books.
Page no: 2
Table of Contents
1. Introduction to GitHub ............................................................................ 4
2. Advantages of GitHub ............................................................................. 5
2.1 GitHub Plugin Setup in Anypoint Studio ........................................ 6
2.2 Saving a Studio Project to Git .......................................................... 8
2.3 Registering a Local Repository ...................................................... 11
2.4 Committing Changes to the Local Repository .............................. 13
2.5 Committing and Pushing to a Remote Repository ....................... 14
2.6 Importing a Git Project into Studio ................................................ 15
2.7 Importing from a Local Drive......................................................... 15
2.8 Importing From a Remote Repository ........................................... 17
2.9 Cloning and Pulling from a Remote Repository ........................... 19
3. References............................................................................................... 22
Page no: 3
1. Introduction to GitHub
GitHub is a Web-based Git repository hosting service. It offers all of the distributed revision
control and source code management (SCM) functionality of Git as well as adding its own
features. Unlike Git, which is strictly a command-line tool, GitHub provides a Web-based
graphical interface and desktop as well as mobile integration. It also provides access control and
several collaboration features such as bug tracking, feature requests, task management,
and wikis for every project
A user must create an account in order to contribute content to the site, but public repositories
can be browsed and downloaded by anyone. With a registered user account, users are able to
discuss, manage, create repositories, submit contributions to others' repositories, and review
changes to code
Page no: 4
2. Advantages of GitHub
GitHub is mostly used for code.
In addition to source code, GitHub supports the following formats and features:
Documentation, including automatically-rendered README files in a variety of Markdownlike file formats (see README files on GitHub)
Issue tracking (including feature requests) with labels, milestones, assignees and a search
engine.
Integrations Directory
Unified and split diffs.
Email notifications.
So, Git is a version control system, Version control systems keep these revisions straight, and
store the modifications in a central repository. This allows developers to easily collaborate, as
they can download a new version of the software, make changes, and upload the newest revision.
Every developer can see these new changes, download them, and contribute.
Repository
A repository is a location where all the files for a particular project are stored, usually
abbreviated to repo. Each project will have its own repo, and can be accessed by a unique
URL.
Page no: 5
Page no: 6
7. In the Review Licenses panel, select I accept the terms of the license agreement, and then
click Finish.
8. After Mule has installed the Egit plugin, click Yes to complete the installation and restart Studio.
Page no: 7
2. A new wizard to select the repository plugin that will be used to share the selected project and click
Next. (If multiple plugins are installed)
Page no: 8
4. In the Create a Git Repository panel, click Browse then navigate to the git folder on your local drive
Page no: 9
5. Mule populates the fields in the Configure Git Repository panel to correspond with the folder you
created for your new Git repository on your local drive. Check the box next to your projects line item
in the list, then click Finish.
6. In the Mule Studio Package Explorer, notice the small question mark icon that appears next to your
project name (below). This icon indicates that you have created a Git repository for your project on
your local drive, but you have not yet registered it and are not yet tracking changes to the project.
Page no: 10
If you have not yet identified yourself to Git as a user, the Identify Yourself panel may appear at this
point. Enter a User name and User e-mail that Git can use to identify you and the commits that you make
to your Git repository.
2. In the Commit Changes panel, commit the inaugural version of your Studio project which will
effectively register the project on your local drive. In the Commit message field, enter a description of
Page no: 11
the project you are about to commit to the repository. (In the future, when you commit changes to the
project to your repository, use the Commit message field to record the changes that you have made to
the project since your last commit.
3. In the Files pane, notice that Mule has applied a question mark icon to each of the items in
the list. This icon indicates that the file is "untracked" in Git (i.e. the file has not yet been
saved in the repository). Click the checkbox next to each item to select all of them.
Page no: 12
5. Click the box next to all items listed in the Files pane, then click Commit to save your changes to
your local Git repository.
Page no: 13
Page no: 14
If you have already cloned your Git repository and stored it on your local drive, follow the
procedure for importing a Project from a Local Drive.
If you have not yet cloned your Git repository and stored it on your local drive, follow the
procedure for Importing From a Remote Repository
2.
In the Import wizard, click the expand arrow next to the Git folder, and then select Projects
from Git.
3. Click Next to continue.
4. In the Import Projects from Git wizard, select Local, and then click next.
5. Click to select a Git repository from the list of repositories on your local drive, and then
click next.
6. Select Import existing projects from the list of import methods, then click to select
the Working Directory folder
Page no: 15
7. Click Next
8. Use the drop-down menu in the Working sets field to select the project you wish to import,
and then click Finish.
9. Known Issue: Under the Projects menu, select Clean to scrub the project and ensure that
Studio has created a consistent build path.
10. Under the File menu, select Open, then navigate to the cloned repository on your hard drive
to open your project and work with it in Studio.
Page no: 16
4. In the Import Projects from Git wizard, select URI, and then click Next.
5. In the URI field, identify your user name and the name of your Git repository. Use the
following format to enter the information:[email protected]:username/repository-name.git.
When you enter this information, Studio automatically completes the remaining required fields
in the panel.
6. Click Next.
7. In the list of branches in your Git repository, click the boxes next to the branch (or branches) of
your project that you wish to check out and work on in Studio.
8. Click Next to continue.
9. Select the directory on your local drive to which you want to clone and save your project, then
click Next. Git clones the branch(es) you selected and stores them on your local drive.
Page no: 17
10. Select Import existing projects from the list of import methods, select the working
11. Use the drop-down menu in the Working sets field to select the project you wish to import, and
then click Finish.
12. Known Issue: Under the Projects menu, select Clean to scrub the project and ensure that Studio
has created a consistent build path
13. Under the File menu, select Open then navigate to the cloned repository on your hard drive to
open your project and work with it in Studio.
Page no: 18
5. In Package Explorer, double-click the name of the flow(s) in your project to reopen them on
your Studio canvas.
How to fork a Repository
Fork: A fork is a copy of a repository. Forking a repository allows you to freely experiment with
changes without affecting the original project.
Page no: 19
Step 3: Configure Git to sync your fork with the original Spoon-Knife repository
When you fork a project in order to propose changes to the original repository, you can configure
Git to pull changes from the original, or upstream, repository into the local clone of your fork
1. On GitHub, navigate to the octocat/Spoon-Knife repository.
2. In the right sidebar of the repository page, click to copy the clone URL for the repository.
3. In Command prompt Change directories to the location of the fork you cloned
To go to your home directory, type just cd with no other text.
To list the files and folders in your current directory, type ls.
To go into one of your listed directories, type cd your_listed_directory.
To go up one directory, type cd...
Page no: 20
4.
Type git remote -v and press Enter. You'll see the current configured remote repository
for your fork.
git remote -v
# origin https://github.com/ SUDHA_CH/SUDHA_CLONE.git (fetch)
# origin https://github.com/ SUDHA_CH/SUDHA_CLONE.git (push)
5. Type git remote add upstream, and then paste the URL you copied in Step 2 and press
Enter. It will look like this:
git remote add upstream https://github.com/octocat/Spoon-Knife.git
6. To verify the new upstream repository you've specified for your fork, type git remote -v
again. You should see the URL for your fork as origin, and the URL for the original
repository as upstream.
git remote -v
# origin https://github.com/SUDHA_CH/SUDHA_CLONE.git (fetch)
# origin https://github.com/ SUDHA_CH/SUDHA_CLONE.git (push)
# upstream https://github.com/ SUDHA_CH/SUDHA_CLONE.git (fetch)
# upstream https://github.com/ SUDHA_CH/SUDHA_CLONE.git (push)
Page no: 21
3. References
Please refer to the below site for more information on using GitHub
1.
2.
3.
4.
https://github.com/
http://stackoverflow.com/questions/tagged/github
https://docs.mulesoft.com/mule-user-guide/v/3.3/using-git-with-studio
http://mulesoft.github.io/magento-connector/
Page no: 22