Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Codewind Git Repo Setup"
(Update title) |
(Clean up, add header links and add diagram) |
||
Line 3: | Line 3: | ||
Complete the following steps to setup your Codewind Git repository. | Complete the following steps to setup your Codewind Git repository. | ||
− | * | + | * [[#Step_1:_Create_a_fork_of_repo | Step 1: Create a fork of repo]] |
− | * | + | * [[#Step_2:_Setting_up_the_inbound.2Foutbound_.22triangle.22 | Step 2: Setting up the inbound/outbound "triangle"]] |
− | + | ||
− | == Step 1 : Create a fork of repo == | + | == Step 1: Create a fork of repo == |
In this document, the eclipse/codewind repo is used as an example but the setup process is the same for other Codewind repos (you just need to replace the codewind repo name with the one that you are working on). The complete list of Codewind repos can be found in [https://projects.eclipse.org/projects/ecd.codewind/developer Codewind Project-Developer Resources]. | In this document, the eclipse/codewind repo is used as an example but the setup process is the same for other Codewind repos (you just need to replace the codewind repo name with the one that you are working on). The complete list of Codewind repos can be found in [https://projects.eclipse.org/projects/ecd.codewind/developer Codewind Project-Developer Resources]. | ||
− | Navigate to the corresponding repo page, e.g. https://github.com/eclipse/codewind | + | Navigate to the corresponding repo page, e.g. https://github.com/eclipse/codewind, and click the '''Fork''' in the top upper right corner and select your account as the location to hold the fork. If you already have a fork, click the '''Fork''' button will bring you to your existing fork. |
− | + | Your fork will be called ''<github-user>''/codewind. | |
− | == Step 2 : Setting up the inbound/outbound "triangle" == | + | == Step 2: Setting up the inbound/outbound "triangle" == |
'''NOTE''': The following highlighted commands are utilized from a Git-Bash command window. Also ensure that you've started your SSH agent. | '''NOTE''': The following highlighted commands are utilized from a Git-Bash command window. Also ensure that you've started your SSH agent. | ||
− | + | Github Triangular Workflow:<br/> | |
+ | [[File:CodewindGitTriangleSetup.png]] | ||
First, create a directory on your local system to hold the source code. | First, create a directory on your local system to hold the source code. | ||
Line 32: | Line 32: | ||
''git clone git@github.com:eclipse/codewind.git'' | ''git clone git@github.com:eclipse/codewind.git'' | ||
− | Next, setup the second side of the triangle via this command (ensure you change | + | Next, setup the second side of the triangle via this command ('''NOTE: '''ensure you change ''<github-user>'' to your public github.com user name): |
''cd codewind'' | ''cd codewind'' | ||
''git remote add my_fork git@github.com:<github-user>/codewind.git'' | ''git remote add my_fork git@github.com:<github-user>/codewind.git'' | ||
− | |||
− | |||
Next, configure the local repository to push your commits to the fork repository you created above: | Next, configure the local repository to push your commits to the fork repository you created above: |
Revision as of 18:03, 20 June 2019
Setup Git Environment for Codewind Development
Complete the following steps to setup your Codewind Git repository.
Step 1: Create a fork of repo
In this document, the eclipse/codewind repo is used as an example but the setup process is the same for other Codewind repos (you just need to replace the codewind repo name with the one that you are working on). The complete list of Codewind repos can be found in Codewind Project-Developer Resources.
Navigate to the corresponding repo page, e.g. https://github.com/eclipse/codewind, and click the Fork in the top upper right corner and select your account as the location to hold the fork. If you already have a fork, click the Fork button will bring you to your existing fork. Your fork will be called <github-user>/codewind.
Step 2: Setting up the inbound/outbound "triangle"
NOTE: The following highlighted commands are utilized from a Git-Bash command window. Also ensure that you've started your SSH agent.
First, create a directory on your local system to hold the source code.
mkdir codewind cd codewind
Windows users: Set this config flag to allow file paths to go beyond 260 chars.
git config --global core.longpaths true
Clone the main repository onto your local system via this command.
git clone git@github.com:eclipse/codewind.git
Next, setup the second side of the triangle via this command (NOTE: ensure you change <github-user> to your public github.com user name):
cd codewind git remote add my_fork git@github.com:<github-user>/codewind.git
Next, configure the local repository to push your commits to the fork repository you created above:
git config remote.pushdefault my_fork
This will now pull from origin, the main repository, and push to the fork, your fork repository.
This option requires at least Git 1.8.4. It is also recommended that you configure
git config push.default simple
unless you are already using Git 2.0 where it is the default. Don't know what version you have?
git --version
Finally, the third side of the triangle is pull requests from your fork repo to the main repo.
You can run the following command to verify your triangle was created successfully:
git remote -v
You should see output similar to the following:
> $ git remote -v > my_fork git@github.com:<github-user>/codewind.git (fetch) > my_fork git@github.com:<github-user>/codewind.git (push) > origin git@github.com:<github-user>/codewind.git (fetch) > origin git@github.com:<github-user>/codewind.git (push)
You will need to setup your 'master' branch since integration is the default:
> $ git checkout -b master origin/master > $ git pull > $ git push