git workflow for D

Ali Çehreli acehreli at yahoo.com
Mon Dec 4 20:14:15 UTC 2017


On 12/03/2017 12:05 PM, bitwise wrote:
 > I've finally started learning git

git is one of those things where as soon as you understand how it works, 
you lose the ability to teach. :) I'm watching this thread with 
amusement because like most online tutorials, nobody is mentioning the 
relationship of *three* repos in the picture:

- The original repo, which will be updated by others frequently

- Your clone of it on GitHub which will be hopelessly behind unless you 
update it (if I'm not mistaken, none of the replies mentioned '-force')

- Your local (e.g. laptop) clone of your GitHub clone, where you do all 
the work

Dear git experts, given 3 repos, now what are the steps? Is the 
following correct? What are the exact commands?

- Only once, create the original repo as an upstream of your local repo.

- For each change:

1) Fetch from upstream

2) Rebase origin/master (on upstream, right?)

3) Make changes

4) Commit (potentially after 'add')

5) Repeat steps 3 and 4 as needed

6) 'git push -force' so that your GitHub repo is up-to-date right? 
(There, I mentioned "force". :) )

7) Go to GitHub and press the big button to create a pull request

Since I still don't know how git works, :) I trust my steps above but I 
know the steps can use improvement.

Ali



More information about the Digitalmars-d-learn mailing list