Push and Pull
push sends commits to the remote and pull fetches and merges new ones.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
git init -q --bare -b main ../r.git && git remote add origin ../r.git && git push -q -u origin main
cd ..; git clone -q r.git other; cd other
echo two >> a.txt && git commit -qam 'from other' && git push -q
cd ../repo && git pull -q
git log --format=%sResult
from other first
Exercise
Download and merge.
git Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.