From the course: Git for System Administration

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Getting and pushing to a remote repository

Getting and pushing to a remote repository - Git Tutorial

From the course: Git for System Administration

Start my 1-month free trial

Getting and pushing to a remote repository

- [Instructor] Now that we have a remote repository set up, we want to make changes and push those up to it. I'm still in my second host that we used to clone the repo in. If you've done this on the same host as the rest of the course, that's fine. Just be sure you're in the right directory. For me, this is /home/grant/RemoteRepos/GitProjectOne. Now let's edit ourfirstfile.txt again. Type in vim ourfirstfile.txt and hit Enter. Go into insert mode by pressing your I key. And then let's add a line that says, This line added remotely. And then save and exit by pressing Escape :x! and hitting Enter. Now let's look at our Git status. Type in git status and hit Enter. Here we see our changes. Now let's commit this change by typing git commit -a -m "This adds a remote line" and hit Enter. Now check the status again by typing in git status. You'll notice that the message says, your branch is ahead of origin/master by one commit. Use Git push to publish your local commits. So let's push these…

Contents