I have two branches namely
development in a GitHub Repository. I am doing all my development in development branch as shown.
git branch development
git add *
git commit -m "My initial commit message"
git push -u origin development
Now I want to merge all the changes on the
development branch into the
master . My current approach is:
git checkout master
git merge development
git push -u origin master
Please let me know if the procedure I am following is correct.
usually you don’t push your topic branches to origin, but to your own fork. But yes, this is how you do merging with merge commit, but in Foreman we do not allow merge commits (we enforce
I recommend you to google out free book called “Pro Git”.
My typical workflow is this:
git checkout -b my_cool_feature origin/develop
git push jturel my_cool_feature
<open pull request>
where ‘jturel’ is a remote pointing at my fork of the codebase:
[vagrant@centos7-devel foreman]$ git remote -v
jturel ssh://firstname.lastname@example.org/jturel/foreman.git (fetch)
jturel ssh://email@example.com/jturel/foreman.git (push)
upstream https://github.com/theforeman/foreman.git (fetch)
upstream https://github.com/theforeman/foreman.git (push)
If there are new changes that I want to include in my local branch, I rebase after committing everything locally:
git fetch upstream
git rebase upstream/develop