2023-08-07 21:11:03 -04:00
|
|
|
# New projects
|
|
|
|
|
2023-08-10 12:50:16 -04:00
|
|
|
## Creating the main repository
|
|
|
|
This will initialize and create an empty git repository.
|
|
|
|
1. Visit `git.tams.tech/tws` and click "`New Repository`".
|
|
|
|
2. Set the 'Owner' to `TWS`.
|
|
|
|
3. Give the repository/project a name. Good repository names use short, memorable and unique keywords.
|
|
|
|
4. _(optional but recommended)_ Enter a short description of what this repo does / is for.
|
|
|
|
5. Scroll down to the bottom of the page and press "`Create Repository`".
|
|
|
|
|
|
|
|
## Clone the main repository
|
|
|
|
Here we will clone the main repository and do some initial setup.
|
|
|
|
1. Clone the repository to your machine, where `<PROJECT>` is the name of the project.
|
|
|
|
```
|
|
|
|
git clone https://git.tams.tech/TWS/<PROJECT>
|
|
|
|
cd <PROJECT>
|
|
|
|
```
|
|
|
|
|
|
|
|
2. Create a `README.md` file. This file should have a longer description of what the project is. You can be as detailed as you like.
|
|
|
|
```
|
|
|
|
touch README.md
|
|
|
|
```
|
|
|
|
|
|
|
|
3. Create a `.gitignore` file. This file should include any file, extension, directory, or pattern you wish to **NOT** be tracked by git.
|
|
|
|
```
|
|
|
|
touch .gitignore
|
|
|
|
```
|
|
|
|
|
|
|
|
4. Push the initial work done so far.
|
|
|
|
```
|
|
|
|
git add .
|
|
|
|
git commit -m init
|
|
|
|
git push origin main
|
|
|
|
```
|
|
|
|
5. Once the changes can be seen at `https://git.tams.tech/TWS/<PROJECT>`, you can delete the local repository on your computer.
|
|
|
|
|
|
|
|
## Forking the project
|
|
|
|
All work to a project should ideally be done in a fork and not in the main repository.
|
|
|
|
This write up will walk you through the process of forking through the web interface.
|
|
|
|
|
|
|
|
1. Visit `https://git.tams.tech/TWS/<PROJECT>` and in the upper right hand corner press "`Fork`".
|
|
|
|
2. Leave everything default as all the information for 'Owner', 'Repository Name' & 'Description' should be correct. Press "`Fork Repository`".
|
|
|
|
3. You should now be able to visit `https://git.tams.tech/<YOU>/<PROJECT>`, where `<YOU>` is your username & `<PROJECT>` is the name of the project.
|
|
|
|
4. Clone the repository to your machine.
|
|
|
|
```
|
|
|
|
git clone https://git.tams.tech/<YOU>/<PROJECT>
|
|
|
|
```
|
|
|
|
5. Add the main repository as upstream. This will allow you to fetch upstream changes and merge them into your fork.
|
|
|
|
```
|
|
|
|
git remote add upstream https://git.tams.tech/TWS/<PROJECT>
|
|
|
|
```
|
|
|
|
**WARNING**: Do **NOT** push to upstream unless you have gone through a Pull Request! Only use the upstream remote to `PULL` in new changes.
|
|
|
|
|
|
|
|
You can now work on the project, commit changes, and submit Pull Requests from your fork to the main upstream repository repository.
|