Push a Local Repository
This document provides the process that allows a user to populate a new GitLab repository with files stored on a local machine.
Step-by-Step Guide
A repository into GitLab.
Pushing local git project to already existing remote repo:
Assumes: local project is a git project and all changes have been committed and are up to date locally.
- Navigate to local git repository folder.
- Confirm valid git repository.
- git status.
- git remote add origin < URL of remote repo >.
- git pull --set-upstream origin < branch name on remote repo > --allow-unrelated-histories.
- *git push.
Assumptions Prior to Start:
- Local project is a Git project.
- All Changes have been committed and are up-to-date locally.
Process
- Navigate to local Git repository folder. a. This implies Git repository is valid but to confirm you can execute the command
git status
- Execute the following commands:
bash
git remote add origin < URL of remote repo >.
git pull --set-upstream origin < branch name on remote repo > --allow-unrelated-histories.
git push