When the project is hosted privately on a remote Git server
Important! You must establish a VPN connection to the remote Git server.
- Open a Git bash prompt. You can simply click the shortcut on your Taskbar (or “C:Program Files (x86)Gitbinsh.exe” –login -i).
- 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
-
Using your web browser, navigate to the project site on GitHub (for example, https://github.com/3rdParty/java_3rdParty.git), and click “Fork.”
-
Navigate to your new forked version (https://github.com/%USERNAME%/java_3rdParty/).
-
Clone the new forked version (i.e., make a local working copy of it). To Clone from the Python Bash (the preferred method).
- Launch MINGW32 (click the icon in the Task Bar).
- 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 Windows: http://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.
- cd to the new enlistment directory (e.g., java_3rdParty).
- 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).
- Fetch from both origin and upstream. This brings in new branch ‘master’ -> upstream/master.
git fetch --all
- Create a new local branch called develop, and check it out.
git checkout -b develop
Switched to a new branch 'develop'
- 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
- git clone https://github.com/%USERNAME%/python_3rdParty_sdk.git.
- cd python_3rdParty.
- git remote add upstream https://github.com/3rdParty/python_3rdParty.git.
- git fetch –all. This fetches from both origin and upstream. This brings in new branch ‘master’ -> upstream/master.
- git checkout -b develop. This create a new branch called ‘develop’, based on a snapshot of ‘master’.
- git checkout -b feature/doc_update.
- git push origin feature/doc_update.