I have a requirement,
- I need to clone a remote branch to Local.
- Add some files the local folder
- Push the changes to some other existing remote branch.
But, when I do got push, it is actually cloning the remote branch details in to my local, and then pushing it. Because of that, I am losing the newly added files in my local (those will be overwrite) and those files will not push to the other branch.
The command I am using to push is as below:
git init
cd git_test
git fetch
git checkout repobranchB
git add -A
git commit -m "test"
git push
Is there any option in git push, where it will not clone the existing files in the remote branch to local? I just need to add all the files in my local to the specified remote branch.