I'm new to git and haven't gotten the idea of the workflow fully. So I've created a repository on the github.com and have been able to push all the files from my computer. Now I've created a new repo on the github and created a new folder on my computer. Everything gets pushed from the new folder, but it gets pushed in the old repository, as opposed to the new one. How do I switch to the new repository? Thank you for your help in advance.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
You can use
git remote
to view and edit the upstream repositories your local repo is connectted to. To view current remote reposEach repo has a
fetch
and apush
address that are used to fetch from the repo and push to the repo respectively. These are separate to allow setups where the fetch happens overhttp
but the push happens overssh
for instance.Use
git remote rm alias
to remove an old remote repository andto add a new one (just replace "alias" with the actual alias you want to use).
When you do a
git clone
a new remote is added by default under the aliasorigin
, this is just a convention and you can name the aliases what ever you wish.You can have more then one remote repository and when you
push
just define which one you want to push toTo push from a different repo, you need to move to the path of that new project and type again:
*for each new project you need to type 'Git init' again
Also, add the new repo of github as remote in the new project since the path of the new project
*Replace with the appropiate