39 lines
1.2 KiB
Markdown
39 lines
1.2 KiB
Markdown
git remote add private http://gitea.damconsulting.net:3000/peskyadmin/DAM-static-site.git
|
||
|
||
1. Check Your Current Remote
|
||
Since you’ve cloned a project, it already has one remote configured (usually named origin). You can verify this by running:
|
||
bash
|
||
|
||
`git remote -v`
|
||
|
||
This will show the URL of the public repository you cloned from (e.g., https://github.com/user/public-repo.git).
|
||
|
||
2. Add a Second Remote
|
||
To push to your private repository, you need to add it as a new remote. Let’s call it private. Run:
|
||
bash
|
||
|
||
`git remote add private http://gitea.damconsulting.net:3000/peskyadmin/DAM-static-site.git`
|
||
|
||
|
||
|
||
`git remote -v` shows remotes
|
||
|
||
|
||
3. Pull from the Public Remote
|
||
To keep your local repository updated with changes from the public remote, use:
|
||
bash
|
||
|
||
`git pull origin main`
|
||
|
||
Replace <branch> with the branch you’re working on (e.g., main or master). This fetches and merges updates from the public repo into your local branch.
|
||
|
||
|
||
4. Push to the Private Remote
|
||
After making your changes locally and committing them (with git add and git commit), you can push them to your private repository:
|
||
bash
|
||
|
||
`git push private main`
|
||
|
||
This sends your commits to the specified branch in your private repo, not the public one.
|
||
|