diff --git a/gitcli-basics/README.md b/gitcli-basics/README.md index 500b9fa264ec2f6e04424c6c489fcdf83a5de13c..1deedcd40d5111c03278ade7eccf7f631516fd19 100644 --- a/gitcli-basics/README.md +++ b/gitcli-basics/README.md @@ -92,6 +92,32 @@ The following screenshot shows the result of a commit on our pet project after t - The last lines of the commit show a summary of what has been actually committed. +## Propagating local changes to the remote repository + +To update a remote repository with all the commits that have been made locally, the `git push` [[command](https://git-scm.com/docs/git-restore)] is used. It needs no arguments or options, because it "knows" which part of the history is local and needs to be propagated to the remote repository. + +To know what will be propagated, you can use `git status` as in the following example: + + + +It shows that the local repository is one commit *ahead* of the remote repository. Meaning, that one local commit (the latest) will be propagated to the remote repository. + +The actual output of `git push` looks like: + + + +Notice the last line, with two commit ids (the one of the latest commit when cloning the repository, and the latest local commit id), and the names of the branches involved in the commit. + +On GitLab, the project welcome page displays information about the latest commit that has been pushed to the repository. + + + + + + + + + diff --git a/gitcli-basics/media/git_push.png b/gitcli-basics/media/git_push.png new file mode 100644 index 0000000000000000000000000000000000000000..d832e26412c2ff2cc90b1d1001e1264f2d8a5923 Binary files /dev/null and b/gitcli-basics/media/git_push.png differ diff --git a/gitcli-basics/media/gitlab_after_push.png b/gitcli-basics/media/gitlab_after_push.png new file mode 100644 index 0000000000000000000000000000000000000000..24072fafdfeb5ca048969e9f64be99cdba4142d1 Binary files /dev/null and b/gitcli-basics/media/gitlab_after_push.png differ diff --git a/gitcli-basics/media/status_before_push.png b/gitcli-basics/media/status_before_push.png new file mode 100644 index 0000000000000000000000000000000000000000..0387d741d99dc82168209ec9eef5a06738fda9e0 Binary files /dev/null and b/gitcli-basics/media/status_before_push.png differ