Begin a Project Without Starter Code
This guide is for when your team is not given an existing Github repository at the beginning of the project.
Tip: Remember that curly braces in commands below should not be typed by you. They indicate that you should place your own value there without curly braces.
Initializing the Repository
The following steps must be done by one, and only one, teammate. Everyone else wait until these steps are completed.
- Change to the workspace directory in your terminal with.
cd ~/workspace
- Create a directory for your project, and navigate to that directory.
mkdir {project name} cd {project name}
- Create a default documentation file for the project.
touch README.md
- Run the
git init
command. - Run
git add README.md
. - Run
git commit -m "Initial commit"
- Go to your cohort’s Github organization.
- Create a new repository by clicking the New button.
- Provide a brief, but accurate name for it.
- Do not check the Create a README file checkbox.
- Click the button at the bottom to create the repository
- Click the Code button.
- Ensure that SSH option is chosen, and not HTTPS.
- Copy the connection string provided.
- Back in your terminal run the following command.
git remote add origin {connection string}
- Run
git push -u origin main
to push your first commit to Github. - Run
git switch -c develop
to create the active development branch. - Run
git push -u origin develop
to create the branch on Github. - Share the public URL to the repository with your team.
Cloning the Repository
Everyone else on the team should follow these steps now.
- Visit the URL your teammate shared.
- Click the Code button.
- Ensure that SSH option is chosen, and not HTTPS.
- Copy the connection string provided.
- Back in your terminal run the following commands.
cd ~/workspace git clone {connection string}