Alex Rivera | Logout

Are there best practices, other than stash, for using git-pull when our workflow includes a lot of uncommitted code?

Asked 2012-06-24T08:05:17.387
9

My team and I are new to Git; we have used CVS so far. We have a remote repository and each one of us has his own repository. Each one of us is working on a feature or bug, but some of us may work on different parts of the same feature.

When one is done they commit and push their changes. Another programmer may want to use that code (for example, if one is working on BL, and another one on UI), but without committing anything as the code may not even compile yet or the working directory may still be dirty.

So far I've only found out a suggestion to use stash, but we find it uncomfortable. We want to pull the code from the remote and simply get it merged with the uncommitted code, but as far as I understand Git, this is probably impossible.

What do you think would be the best way for us to work with the remote?

Edit
Report

1 Answer

8

As long as you are not pushing your own code, you can commit, and then git pull.

A commit will remain private to your repo until your next push.

git push

So you can work on the same 'feature' branch, and still benefit from the push of your colleague.

But if you must also publish your work, then you can use a 'developerX_feature' branch, in order for you to push your own branch, and for other to fetch and then merge your branch to their own 'developerY_feature' branch in their local repo.

answered 2012-06-24T08:13:18.100

Your Answer