Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Orion/Server API/Git API"
m (git commands and corresponding bugzillas) |
m (→Git commands) |
||
Line 4: | Line 4: | ||
=== git add === | === git add === | ||
+ | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=338200 bug 338200] | ||
+ | |||
=== git branch === | === git branch === | ||
+ | no bug yet | ||
+ | |||
=== git checkout === | === git checkout === | ||
+ | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339107 bug 337818] | ||
+ | |||
=== git clone === | === git clone === | ||
+ | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=337818 bug 337818] | ||
+ | |||
=== git config === | === git config === | ||
− | = | + | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=337820 bug 337820] |
+ | === git commit === | ||
see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=338203 bug 338203] | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=338203 bug 338203] | ||
=== git fetch === | === git fetch === | ||
+ | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339110 bug 339110] | ||
+ | |||
=== git log === | === git log === | ||
+ | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339104 bug 339104] | ||
+ | |||
=== git merge === | === git merge === | ||
+ | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339111 bug 339111] | ||
+ | |||
=== git pull === | === git pull === | ||
− | + | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339114 bug 339114] | |
− | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id= | + | |
=== git push === | === git push === | ||
+ | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339115 bug 339115] | ||
+ | |||
+ | === git remote === | ||
+ | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339109 bug 339109] | ||
+ | |||
=== git reset === | === git reset === | ||
+ | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=338202 bug 338202] | ||
+ | |||
=== git revert === | === git revert === | ||
see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339105 bug 339105] | see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=339105 bug 339105] |
Revision as of 07:57, 14 March 2011
The Git API is a web server API for browsing and manipulating Git repositories.
Git commands
git add
see bug 338200
git branch
no bug yet
git checkout
see bug 337818
git clone
see bug 337818
git config
see bug 337820
git commit
see bug 338203
git fetch
see bug 339110
git log
see bug 339104
git merge
see bug 339111
git pull
see bug 339114
git push
see bug 339115
git remote
see bug 339109
git reset
see bug 338202
git revert
see bug 339105
git status
#Getting status for a git project
git tag
see bug 339108
REST API
Getting status for a git project
- Overview
- To retrieve the working tree status of a project, send a GET request to the git status location.
- HTTP Method
- GET
- Example Request
GET /git/status/file/MyProj/
- Example Response
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 22
TBD
- Detailed Explanation
- TBD.
Progress in being tracked on bug 337212.
Getting a diff
- Overview
- To retrieve changes between selected commits, commit and working tree, and so on. Send a GET request to the git diff location.
- HTTP Method
- GET
- Example Request
GET /git/diff/file/MyProj/
- Example Response
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 22
TBD
- Detailed Explanation
- TBD.
Getting a file content from index
- Overview
- To retrieve file content kept in index. Send a GET request to the git index location.
- HTTP Method
- GET
- Example Request
GET /git/index/file/MyProj/file.txt
- Example Response
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 22
This is the contents
- Detailed Explanation
- TBD.
Progress is being tracked on bug 337212.
Configuring git
Progress is being tracked on bug 337820.
Staging files
- Overview
- To stage a file, add it to index. Send a PUT request to the git index location.
- HTTP Method
- PUT
- Example Request
PUT /git/index/file/MyProj/file.txt
- Example Response
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 22
<nothing>
- Detailed Explanation
- TBD.
Unstaging files
- Overview
- To unstage a file, reset index and/or working tree. Send a POST request to the git index location.
- HTTP Method
- POST
- Example Request
POST /git/index/file/MyProj/file.txt
{
"Reset" : "MIXED"
}
- Example Response
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 22
<nothing>
- Detailed Explanation
- TBD.
Progress is being tracked on bug 338202.
JSON representations
File representation extension
The JSON representation for files and directories used by file API may be extended as follows: Required fields are shown in bold. A client cannot rely on the existence of non-required attribute in a file representation from a given Orion server.
Field | Data type | Value |
---|---|---|
Git.DiffLocation | URI | Location of Git Diff resource |
Git.StatusLocation | URI | Location of Git Status resource |
Git.IndexLocation | URI | Location of Git Index resource |