Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
ac2cd5a4
Commit
ac2cd5a4
authored
Oct 09, 2018
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor GitHub import raketask docs
parent
813519af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
36 deletions
+18
-36
doc/administration/raketasks/github_import.md
doc/administration/raketasks/github_import.md
+18
-36
No files found.
doc/administration/raketasks/github_import.md
View file @
ac2cd5a4
# GitHub import
>**Note:**
>
> - [Introduced][ce-10308] in GitLab 9.1.
> - You need a personal access token in order to retrieve and import GitHub
> projects. You can get it from: https://github.com/settings/tokens
> - You also need to pass an username as the second argument to the rake task
> which will become the owner of the project.
> - You can also resume an import with the same command.
> [Introduced]( https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10308) in GitLab 9.1.
In order to retrieve and import GitHub repositories, you will need a
[
GitHub personal access token
](
https://github.com/settings/tokens
)
.
A username should be passed as the second argument to the rake task
which will become the owner of the project. You can resume an import
with the same command.
Bear in mind that the syntax is very specific. Remove any spaces within the argument block and
before/after the brackets. Also, Some shells (e.g., zsh) can interpret the open/close brackets
(
`[]`
) separately. You may need to either escape the brackets or use double quotes.
## Importing multiple projects
To import a project from the list of your GitHub projects available:
```
bash
# Omnibus installations
sudo
gitlab-rake
import:github[access_token,root,foo/bar]
sudo
gitlab-rake
"import:github[access_token,root,foo/bar]"
# Installations from source
bundle
exec
rake
import:github[access_token,root,foo/bar]
RAILS_ENV
=
production
bundle
exec
rake
"import:github[access_token,root,foo/bar]"
RAILS_ENV
=
production
```
In this case,
`access_token`
is your GitHub personal access token,
`root`
is your GitLab username, and
`foo/bar`
is the new GitLab namespace/project that
will get created from your GitHub project. Subgroups are also possible:
`foo/foo/bar`
.
## Importing a single project
To import a specific GitHub project (named
`foo/github_repo`
here):
```
bash
# Omnibus installations
sudo
gitlab-rake
import:github[access_token,root,foo/bar,foo/github_repo]
sudo
gitlab-rake
"import:github[access_token,root,foo/bar,foo/github_repo]"
# Installations from source
bundle
exec
rake import:github[access_token,root,foo/bar,foo/github_repo]
RAILS_ENV
=
production
```
[
ce-10308
]:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10308
## Troubleshooting
*
Syntax is very specific. Remove spaces within argument block and prior to brackets
```
# Success
sudo gitlab-rake import:github[access_token,root,foo/bar]
# Fail
sudo gitlab-rake import:github[access_token, root, foo/bar]
rake aborted!
Don't know how to build task 'import:github[access_token, root, foo/bar,' (see --tasks)
```
*
Some shells can interpret the open/close brackets (
`[]`
) separately (ex: zsh). You may need to escape the brackets or switch shells
```
zsh: no matches found: import:github[token,root,foo/project,group/repository]
bundle
exec
rake
"import:github[access_token,root,foo/bar,foo/github_repo]"
RAILS_ENV
=
production
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment