To change the git remote repository that I saved while working on it, On Terminal
git remote set-urlorigin New remote storage address.git Enter to change the remote repository and then
I tried to push by entering git push-u origin master When the message rejected came up, a hint came out like the attached image file
git to change remote repository Does git remote set-urlorigin need to go through a process other than the instruction statement? (For example, you have to disconnect the existing git remote repository.))
How can I change git remote repository?
This message is caused by a difference between a local repository and a remote repository.
After importing the contents of the remote repository into the local repository with pull
, you must: If a conflict occurs during this process, you must do merge
that combines the contents of the remote and local storage. There is also a force push
that forcibly overwrites the contents of the remote repository with the contents of the local repository, but merge
is recommended. Merging on the terminal is not easy. In this case, it is convenient to use tools such as GitKraken.
You can also change the storage in the following ways.
Use git remote -v
to determine the current repository and shortcut name.
git remote set-url Short name (for example, origin) Repository (for example, https://xx)
or git remote remove Short name
-> git remote add Short name New storage
The current status of the local branch and the changed status of the storage branch are different I think I need to push again after I pull and merge. Or, if you can forcefully change the local state to the remote state, you can force pull it.
Open the storage information yourself and see where [remote "origin"" is located.
.git/config
Clear that part and try again from git remote set-urlorigin new address
.
884 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
567 Who developed the "avformat-59.dll" that comes with FFmpeg?
606 Uncaught (inpromise) Error on Electron: An object could not be cloned
597 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.