Steps for creating a new repository in the MOCO Git server. The git platform we are using is GOGS.
Step 1 – Log in
Log in to git.mocodev.com
Step 2 – Create Repository
Repositories should not contain underscores, but dashes are OK.
Click the + in the upper right corner. Then select + New Repository.
Change Owner to MOCO
Set the Repository Name
Add a Description about the project
In the dropdown for .gitignore scroll to the bottom and select macOS and Node
Check the Initialize this repository with selected files and templates.
This should create a repo with README.md. You can select a template (which framework you’re using), but if you need you have to remember that the configuration files generally won’t be committed (.env, wp-config.php, etc.). While this is a good thing, it can cause problems if someone forgets to create theirs for a specific repo.
Press the Create Repository button
Step 3 – Clone
Once the repo is created and your on the repo’s main page. Copy the repository URL Login to dev.mocodev.com from command line and change directory to your projects directory.
cd projects/
git clone <git_repository_url>Code language: Bash (bash)Step 4 – Setting up branches in git
This can be slightly different depending on the site you are cloning, but this is the general practice after cloning. For more on GIT procedures, visit this topic (topic to link to).
Change directory into the newly cloned directory
cd <project_dir>Code language: Bash (bash)
Create the dev branch by doing:
git checkout -b devCode language: Bash (bash)
Push the newly create dev branch for other developers to use:
git push origin devCode language: Bash (bash)
Set upstream to origin/dev:
git branch --set-upstream-to=origin/dev devCode language: Bash (bash)