git:get_started
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| git:get_started [2018/08/27 11:43] – typos | git:get_started [2024/08/20 21:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 151: | Line 151: | ||
| Expected terminal output, | Expected terminal output, | ||
| - | {{git: | + | |
| + | {{git: | ||
| ===== Update a File in Repository | ===== Update a File in Repository | ||
| + | We previously added an empty file, ' | ||
| + | Now let's modify it and update the changes to the remote repository! | ||
| + | < | ||
| + | cd ~/ | ||
| + | echo "Hello World!" | ||
| + | cat my_new_file.txt | ||
| + | </ | ||
| + | The commands above were a quick way to add simple text to our previously empty file. It now contains the text 'Hello World!' | ||
| + | If we run '' | ||
| + | Commit the changed file so that it can be uploaded to the remote server, | ||
| + | < | ||
| + | git commit -am "added some example text" | ||
| + | </ | ||
| + | The ' | ||
| + | |||
| + | Now push the staged changes to the remote repository, | ||
| + | < | ||
| + | git push origin master | ||
| + | </ | ||
| + | |||
| + | Example terminal output is illustrated, | ||
| + | |||
| + | {{git: | ||
| + | |||
| + | We additionally, | ||
| + | |||
| + | {{git: | ||
| ===== Remove a File from Repository | ===== Remove a File from Repository | ||
| + | In our final example walk through, we'll remove the text file we created from the repository and propagate this update/ | ||
| + | |||
| + | < | ||
| + | cd ~/ | ||
| + | git rm my_new_file.txt | ||
| + | </ | ||
| + | |||
| + | '' | ||
| + | |||
| + | Commit the change (ie. file deletion) to be staged for upload to the remote rpo. | ||
| + | < | ||
| + | git commit -m " | ||
| + | </ | ||
| + | |||
| + | Push the change, | ||
| + | < | ||
| + | git push origin master | ||
| + | </ | ||
| + | Example terminal output is illustrated, | ||
| + | {{git: | ||
git/get_started.1535384628.txt.gz · Last modified: 2024/08/20 21:38 (external edit)
