Here I changed the project and made git add .
first git add .
, then all the git commit -m "..."
zakomitel and then push the repository to the master branch. And now I need to push some files to another branch. But how to do that?
1 answer
After your push to the wizard, switch to the correct git checkout branch_name
(or git checkout -b branch_name
if the branch has not been created yet), commit the necessary git commit file.jpg
(for each file) and push the required these git push origin branch_name
files git push origin branch_name
per branch
- does not work.
To https://github.com/**/**.git ! [rejected] gh-pages -> gh-pages (fetch first) error: failed to push some refs to 'https://github.com/**/**.git' подсказка: Updates were rejected because the remote contains work that you do подсказка: not have locally. This is usually caused by another repository pushing подсказка: to the same ref. You may want to first integrate the remote changes подсказка: (eg, 'git pull ...') before pushing again. подсказка: See the 'Note about fast-forwards' in 'git push --help' for details.
- Ivan Petrov - Well, it is written in English and white, that these changes, which are pushed, are not locally. you need to push them yourself, and then push the merged files where necessary - lexxl
|
project
which is a master branch. What do I need to do to switch to thedevelopment
branch? - Ivan PetrovВот у меня есть проект, назовем его project который является мастер веткой.
uh ... in which there is a branch named master. Switch to the development branch -git checkout development
. These are basic things. - KoVadim pmgit
but it never came to practice. The second time it came to practice and again I read the book, but it immediately turned out that there was a greater need in another field and again I forgot what I was reading. Now I am not eager to sit down and read again. I ask around for a day or two, go into what is happening and then read it. 1) So, I switched to another branch and added the files I needed, zakomitil them and push. So you need to work? - Ivan PetrovТак нужно работать?
- but I do not know what you need. But if it does as it should, then it must be done that way. but the second point ... I don’t even quite understand what I want to do. - KoVadim 2:49 pm