I'm working half time at home, half time at the office. Each task must be done into a dedicated, separated, branch, merged after peer review.
Our project is backed by Bitbucket, we use Jira and Jenkins too.
I use only one remote repository and two local repositories.
I have a recurrent problem: some conflicts occurs between me (@home) and me (@agency)...
here is my process:
Monday, at the office, in a branch named "JamesBond007" derived from master :
git add --all
git commit [--amend]
git push [-f] origin remote/JamesBond007
Tuesday, at home:
git checkout master
git pull
git checkout JamesBond007
git pull --rebase origin master
Wednesday, at the office:
git checkout master
git pull
git checkout JamesBond007
git pull --rebase origin master **<-- conflict: git mergetool command needed!!!**
My workaround:
rm -fr repo
git clone ssh:repos-url
Where is my mistakes, how can I push/pull code from two local repos to/from the server without conflict?
Mirroring a repository that contains Git Large File Storage objects. Open Terminal . Create a bare clone of the repository. Replace the example username with the name of the person or organization who owns the repository, and replace the example repository name with the name of the repository you'd like to duplicate.
The most popular Git workflow is the usage of pull requests. In this workflow a developer uses a server side functionality to request that commits from a branch (from the same or another repository) are integrated into another branch (in the same or another repository).
I have a very similar setup and never have merge conflicts: I essentially do what you do, but I never use rebase
in any fashion, until possibly at the very end, as part of merging to master.
Concretely:
commit
and push
frequently while I'm working, using the origin
as a backup tool.pull/fetch
on it, and then getting to work there.I know that this is not the preferred "expert" way to work, but it has two awesome benefits:
git pull
and I'm off...If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With