GIT/Hg
SVN/TFS/CVS
(distributed)
(centralized)
Source control server-side
Local working copies are complete repositories
Tom
Dick
Harry
Local working copies are one or more complete branches
Tom
Dick
Harry
"Remote" is a remote version of the repository, eg. hosted on gitlab.gs.mil
Full local working copy
> git clone git@gitlab.gs.mil:GPM/dissemination/fgdrt.git
*Upon regular merge, branch differences are added
as a single merge commit into the destination branch. Rebase
is a cleaner, but more complex, alternative to work in a team environment.
~/myproject [develop] > git pull # does an automatic merge into local develop from remote
~/myproject [develop] > git checkout iss53
~/myproject [iss53] > git merge develop # local gpm-123 branch now has new code from develop
~/myproject [iss53] > git push -u origin iss53 # pushed to remote origin, ready for merge request
Before
After merge
~/myproject [master] > git merge iss53
Upstream
"Origin" or our "fork"
Local
*Typical flow
~/myproject [master] > git remote add upstream git@gitlab.gs.mil:GPM/templates/nestjs-template.git
~/myproject [master] > git fetch --all # This + last command is all we need to add the upstream reference and pull branch refs
#------------ SYNC UPSTREAM "MASTER" BRANCH TO YOUR FORK'S "MASTER" BRANCH ------------
~/myproject [master] > git checkout -b umaster -t upstream/master # checkout a local umaster branch, tracking to upstream/master, yes this step can be replaced by direct merge into origin/master if you're looking to do that
~/myproject [umaster] > git checkout master
~/myproject [master] > git merge umaster # "master" branch in fork now in sync
Upstream => https://github.com/meilinger/example-repo