Reputation: 1061
So I work on a site with which I update via git push from my local to the server. (git push dev/live).
My problem is that currently I have been working on a big change to the site, but there has also arisen some bugs that need fixing on the live site.
How do I go about making small fixes to the live site without pushing the entire local repo to live?
Upvotes: 0
Views: 143
Reputation: 8165
You could use branches to fix your bugs and then merge to the master branch and push to the live website whenever you need.
To create a new branch and immediately switch on it: git checkout -b branchname
(of course you can type any name instead of "branchname").
If you want to change branch just type git checkout
followed by the name of the branch you want to work on (the main branch is called "master").
To merge the new branch into the main one, first switch to the master branch, as explained above (git checkout master
) and then type git merge branchname
. Of course "branchname" will be replaced by the actual name of the branch you want to merge.
For more information you can refer to this article: http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging
Upvotes: 1