Categories
Git How to

How to get an Enlistment

When the project is hosted privately on a remote Git server

Important! You must establish a VPN connection to the remote Git server.

  1. Open a Git bash prompt. You can simply click the shortcut on your Taskbar (or “C:Program Files (x86)Gitbinsh.exe” –login -i).
  2. Make sure you’re in your GIT_HOME directory (%USERPROFILE%\src), and then execute the following commands.
git clone git@git.c11.3rdParty.com:python_rest_api.git

cd python_rest_api

git pull

git checkout feature/api_doc

When the project is hosted on GitHub

When a project is hosted on GitHub, you can’t push your changes to it. Instead, you have to submit a pull request. But you can only do that if you fork the project, and host your fork up on GitHub. But how can you work on content when you repository isn’t local? The answer is you “Clone in Desktop.” So,

The java 3rd party SDK

  1. Using your web browser, navigate to the project site on GitHub (for example, https://github.com/3rdParty/java_3rdParty.git), and click “Fork.”

  2. Navigate to your new forked version (https://github.com/%USERNAME%/java_3rdParty/).

  3. Clone the new forked version (i.e., make a local working copy of it). To Clone from the Python Bash (the preferred method).

    1. Launch MINGW32 (click the icon in the Task Bar).
    2. Execute: git clone https://github.com/%USERNAME%/java_3rdParty.git. Your forked repo on Github automatically becomes the remote for the cloned repo, called “origin”.

OR

To Clone using GitHub for Windows, you must have previously installed GutHub for Windowshttp://windows.github.com/

Note

 

You’ll receive an e-mail message from github.com The following SSH key was added to your account: GitHub for Windows – Production 9d:86:da:ce:4b:e6:c6:d3:c7:47:57:c1:1b:32:f4:c7 If you believe this key was added in error, you can remove the key and disable access at the following location: https://github.com/settings/ssh

You must configure GutHub for Windows to downlad cloned repositories to your %USERPOFILE%/src/ directory. On your new forked repository web page, and click “Clone in Desktop”. Now you have a local, working copy of the project repository.

  1. cd to the new enlistment directory (e.g., java_3rdParty).
  2. Add the original source repo (under the 3rdParty GitHub account) as a remote named “upstream”.
git remote add upstream https://github.com/3rdParty/java_3rdParty.git

When you execute this command, nothing appears to happen (but something does).

  1. Fetch from both origin and upstream. This brings in new branch ‘master’ -> upstream/master.
git fetch --all
  1. Create a new local branch called develop, and check it out.
git checkout -b develop

Switched to a new branch 'develop'
  1. Create a new local branch called feature/doc_update, and check it out.
git checkout -b feature/doc_update

Your github enlistment for the Java sdk:

git@github.com:%USERNAME%/java_3rdParty.git
Note from Humnberto
Chris,
Please pull the latest version of the master branch into your branch and then repush. Run the following commands from your branch. If you haven’t already, please make sure that your upstream is configured.

https://help.github.com/articles/fork-a-repo

Commands to run after upstream has been configured.

git fetch upstream
git merge upstream/master

The python 3rd party SDK

To clone a local working enlistment
  1. git clone https://github.com/%USERNAME%/python_3rdParty_sdk.git.
  2. cd python_3rdParty.
  3. git remote add upstream https://github.com/3rdParty/python_3rdParty.git.
  4. git fetch –all. This fetches from both origin and upstream. This brings in new branch ‘master’ -> upstream/master.
  5. git checkout -b develop. This create a new branch called ‘develop’, based on a snapshot of ‘master’.
  6. git checkout -b feature/doc_update.
  7. git push origin feature/doc_update.

Leave a Reply