Git Workflow for wordfreq
Last modified
Set up remotes for your partner’s repo
There will be two users user1
and user2
. Pick a role, it doesn’t
matter who is who.
-
user1
grant read access touser2
$ ssh git@ece2524.ece.vt.edu perms user1/wordfreq + READERS user2
-
user2
forkuser1
’s repo$ ssh git@ece2524.ece.vt.edu fork user1/wordfreq user2/forks/wordfreq
-
user2
clone a local copy of the fork$ git clone git@ece2524.ece.vt.edu:user2/forks/wordfreq.git ~/ece2524/wordfreq2
-
user2
add a remoteupstream
$ git remote add upstream git@ece2524.ece.vt.edu:user1/wordfreq.git
This will add an entry named
upstream
inuser2
’s remote list$ git remote -v origin git@ece2524.ece.vt.edu:user2/forks/wordfreq.git (fetch) origin git@ece2524.ece.vt.edu:user2/forks/wordfreq.git (push) upstream git@ece2524.ece.vt.edu:user1/wordfreq.git (fetch) upstream git@ece2524.ece.vt.edu:user1/wordfreq.git (push) $
-
user1
make some changes
Have user1
edit their code. Get a working implentation of using
strtol
to parse argv[1]
as an integer, for example. You can leave
off error checking for now. Add and commit your changes, then push to your remote named origin
-
user2
pull updates fromupstream
Now,
user2
can pull in the changes thatuser1
has pushed to their remote$ git pull upstream master
Inspect the source in
main.c
, doesuser2
’s copy look the same asuser1
’s? -
user1
will want to also pull changes fromuser2
Since this will be a collaborative effort, at some point user1
will
need to pull updates made by user2
back into their own repo. They
will set up a remote refering to user2
’s forked code
$ git remote add user2 git@ece2524.ece.vt.edu:user2/forks/wordfreq.git
Summary
Both user1
and user2
should be able to read/pull from the other’s repository
-
user1
has read access touser2/forks/wordfreq
-
user2
has read access touser1/wordfreq
-
user1
has a remote namedorigin
with repo nameuser1/wordfreq
-
user1
has a remote nameduser2
with repo nameuser2/forks/wordfreq
-
user2
has a remote namedorigin
with repo nameuser2/forks/wordfreq
-
user2
has a remote namedupstream
with repo nameuser1/wordfreq
Workflow
-
setup
-
independent work
-
merge