We perform three dimensional smoothed particle hydrodynamics (SPH) simulations of gas accretion onto the seeds of binary stars to investigate their short-term evolution. Taking into account of dynamically evolving envelope with non-uniform distribution of gas density and angular momentum of accreting flow, our initial condition includes a seed binary and a surrounding gas envelope, modelling the phase of core collapse of gas cloud when the fragmentation has already occurred. We run multiple simulations with different values of initial mass ratio q 0 (the ratio of secondary over primary mass) and gas temperature. For our simulation setup, we find a critical value of q c = 0.25 which distinguishes the later evolution of mass ratio q as a function of time. If q 0 q c , the secondary seed grows faster and q increases monotonically towards unity. If q 0 q c , on the other hand, the primary seed grows faster and q is lower than q 0 at the end of the simulation. Based on our numerical results, we analytically calculate the long-term evolution of the seed binary including the growth of binary by gas accretion. We find that the seed binary with q 0 q c evolves towards an equal-mass binary star, and that with q 0 q c evolves to a binary with an extreme value of q. Binary separation is a monotonically increasing function of time for any q 0 , suggesting that the binary growth by accretion does not lead to the formation of close binaries.