I have one repo in github which is public, there I have an Open source application i'm working on that is for making product catalogs, and small cms content.
I also have a private repository (not hosted in github) which is an application developed under the open source application hosted in github.
Since I'm currently working on both applications, adding features in the open source one and also making changes in the private one like changing the template and also pulling the code from the open source one.
I was wondering if there is any way in which I could pull the new stuff from the open source one but also pushing the code of the new application to the other repo.
To push the commit from the local repo to your remote repositories, run git push -u remote-name branch-name where remote-name is the nickname the local repo uses for the remote repositories and branch-name is the name of the branch to push to the repository. You only have to use the -u option the first time you push.
Just for the record, you can clone a git repo within another one: Everything under your lib directory will be ignored by the enclosing Git repo, because said lib directory contains a . git . That means cloning the enclosing repo, and you will get an empty " lib/ " folder.
Set a push URL for the remote that is different from the pull URL:
git remote set-url --push origin [email protected]:repo.git
This changes the remote.name.pushurl
configuration setting. Then git pull
will pull from the original clone URL but git push
will push to the other.
In old Git versions, git remote set-url
did not have the --push
switch. Without it, you have to do this by changing the configuration setting manually:
git config remote.origin.pushurl [email protected]:repo.git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With