Putting your existing work on GitHub Enterprise can let you share and collaborate in lots of great ways.
Tip: If you're most comfortable with a point-and-click user interface, try adding your project with one of our desktop applications. For more information, see "How do I add repositories?" for Mac, and "Adding repositories with GitHub for Windows" for Windows.
- Create a new repository on your GitHub Enterprise instance. Do not initialize the new repository with a README file.
- In Terminal, change the current working directory to your local project.
-
Initialize the local directory as a Git repository.
git init
-
Add the files in your new local repository. This stages them for the first commit.
git add . # Adds the files in the local repository and stages them for commit
-
Commit the files that you've staged in your local repository.
git commit -m 'First commit' # Commits the tracked changes and prepares them to be pushed to a remote repository
In your GitHub Enterprise repository, in the right sidebar, copy the remote repository URL.
-
In Terminal, add the URL for the remote repository where your local repostory will be pushed.
git remote add origin <remote repository URL> # Sets the new remote git remote -v # Verifies the new remote URL
-
Push the changes in your local repository to your GitHub Enterprise instance.
git push origin master # Pushes the changes in your local repository up to the remote repository you specified as the origin
- Create a new repository on your GitHub Enterprise instance.
- In the Command prompt, change the current working directory to your local project.
-
Initialize the local directory as a Git repository.
git init
-
Add the files in your new local repository. This stages them for the first commit.
git add . # Adds the files in the local repository and stages them for commit
-
Commit the files that you've staged in your local repository.
git commit -m 'First commit' # Commits the tracked changes and prepares them to be pushed to a remote repository
In your GitHub Enterprise repository, in the right sidebar, copy the remote repository URL.
-
In the Command prompt, add the URL for the remote repository where your local repostory will be pushed.
git remote add origin <remote repository URL> # Sets the new remote git remote -v # Verifies the new remote URL
-
Push the changes in your local repository to your GitHub Enterprise instance.
git push origin master # Pushes the changes in your local repository up to the remote repository you specified as the origin
- Create a new repository on your GitHub Enterprise instance.
- In Terminal, change the current working directory to your local project.
-
Initialize the local directory as a Git repository.
git init
-
Add the files in your new local repository. This stages them for the first commit.
git add . # Adds the files in the local repository and stages them for commit
-
Commit the files that you've staged in your local repository.
git commit -m 'First commit' # Commits the tracked changes and prepares them to be pushed to a remote repository
In your GitHub Enterprise repository, in the right sidebar, copy the remote repository URL.
-
In Terminal, add the URL for the remote repository where your local repostory will be pushed.
git remote add origin <remote repository URL> # Sets the new remote git remote -v # Verifies the new remote URL
-
Push the changes in your local repository to your GitHub Enterprise instance.
git push origin master # Pushes the changes in your local repository up to the remote repository you specified as the origin