Skip to content

Commit c05bfc8

Browse files
authored
📝 Update instructions to clone for a private repo, including updates (fastapi#1127)
1 parent 27a6c58 commit c05bfc8

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,74 @@ You can **just fork or clone** this repository and use it as is.
5757

5858
✨ It just works. ✨
5959

60+
### How to Use a Private Repository
61+
62+
If you want to have a private repository, GitHub won't allow you to simply fork it as it doesn't allow changing the visibility of forks.
63+
64+
But you can do the following:
65+
66+
- Create a new GitHub repo, for example `my-full-stack`.
67+
- Clone this repository manually, set the name with the name of the project you want to use, for example `my-full-stack`:
68+
69+
```bash
70+
git clone [email protected]:tiangolo/full-stack-fastapi-template.git my-full-stack
71+
```
72+
73+
- Enter into the new directory:
74+
75+
```bash
76+
cd my-full-stack
77+
```
78+
79+
- Set the new origin to your new repository, copy it from the GitHub interface, for example:
80+
81+
```bash
82+
git remote set-url origin [email protected]:octocat/my-full-stack.git
83+
```
84+
85+
- Add this repo as another "remote" to allow you to get updates later:
86+
87+
```bash
88+
git remote add upstream [email protected]:tiangolo/full-stack-fastapi-template.git
89+
```
90+
91+
- Push the code to your new repository:
92+
93+
```bash
94+
git push -u origin master
95+
```
96+
97+
### Update From the Original Template
98+
99+
After cloning the repository, and after doing changes, you might want to get the latest changes from this original template.
100+
101+
- Make sure you added the original repository as a remote, you can check it with:
102+
103+
```bash
104+
git remote -v
105+
106+
origin [email protected]:octocat/my-full-stack.git (fetch)
107+
origin [email protected]:octocat/my-full-stack.git (push)
108+
upstream [email protected]:tiangolo/full-stack-fastapi-template.git (fetch)
109+
upstream [email protected]:tiangolo/full-stack-fastapi-template.git (push)
110+
```
111+
112+
- Pull the latest changes without merging:
113+
114+
```bash
115+
git pull --no-commit upstream master
116+
```
117+
118+
This will download the latest changes from this template without committing them, that way you can check everything is right before committing.
119+
120+
- If there are conflicts, solve them in your editor.
121+
122+
- Once you are done, commit the changes:
123+
124+
```bash
125+
git merge --continue
126+
```
127+
60128
### Configure
61129

62130
You can then update configs in the `.env` files to customize your configurations.

0 commit comments

Comments
 (0)