<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sekinat</title>
    <description>The latest articles on DEV Community by sekinat (@sekinat95).</description>
    <link>https://dev.to/sekinat95</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F69420%2Fdfb6ee25-5d93-4e1e-b790-774ecd21dcc2.jpg</url>
      <title>DEV Community: sekinat</title>
      <link>https://dev.to/sekinat95</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sekinat95"/>
    <language>en</language>
    <item>
      <title>version control with git</title>
      <dc:creator>sekinat</dc:creator>
      <pubDate>Sat, 22 Feb 2020 22:37:24 +0000</pubDate>
      <link>https://dev.to/sekinat95/version-control-with-git-3gb</link>
      <guid>https://dev.to/sekinat95/version-control-with-git-3gb</guid>
      <description>&lt;p&gt;A &lt;em&gt;Version Control System&lt;/em&gt; (in this article, VC) is a software that helps you control (or manage) the different versions...of something (typically source code). some of the most popular VC tools are: &lt;em&gt;git&lt;/em&gt;, &lt;em&gt;subversion&lt;/em&gt; and &lt;em&gt;mercurial&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;thare are two types of VC models: &lt;em&gt;centralized model&lt;/em&gt; and &lt;em&gt;distributed model&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;centralized&lt;/strong&gt;&lt;br&gt;
in this model a central computer control all operations in the system. every action must go through this central model.&lt;br&gt;
&lt;strong&gt;distributed model&lt;/strong&gt;&lt;br&gt;
here there's no central repository, each computer has a complete version of the  on there computer. this means they can also work offline. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;why we need a VC tool&lt;/strong&gt;&lt;br&gt;
to provide us with the ability to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the ability to label a change&lt;/li&gt;
&lt;li&gt;the ability to give a detailed explanation of why a change was made&lt;/li&gt;
&lt;li&gt;the ability to move between different versions of the same document&lt;/li&gt;
&lt;li&gt;the ability to undo change A, make edit B, then get back change A without 
affecting edit B&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt;&lt;br&gt;
Git is a distributed version control system. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git and VC terminologies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;commit&lt;/strong&gt;&lt;br&gt;
You can think of it as a save point in a game - it saves your project's files and any information about them.&lt;br&gt;
&lt;strong&gt;repository&lt;/strong&gt;&lt;br&gt;
A repository is a directory which contains your project work, as well as a few files (hidden by default on Mac OS X) which are used to communicate with Git. Repositories can exist either locally on your computer or as a remote copy on another computer. A repository is made up of commits.&lt;br&gt;
&lt;strong&gt;working directory&lt;/strong&gt;&lt;br&gt;
The Working Directory is the files that you see in your computer's file system. This is in contrast to the files that have been saved (in commits!) in the repository&lt;br&gt;
&lt;strong&gt;checkout&lt;/strong&gt;&lt;br&gt;
A checkout is when content in the repository has been copied to the Working Directory.&lt;br&gt;
&lt;strong&gt;staging area/staging index/index&lt;/strong&gt;&lt;br&gt;
A file in the Git directory that stores information about what will go into your next commit. You can think of the staging area as a prep table where Git will take the next commit&lt;br&gt;
&lt;strong&gt;SHA&lt;/strong&gt;&lt;br&gt;
the id number for each commit&lt;br&gt;
&lt;strong&gt;Branch&lt;/strong&gt;&lt;br&gt;
A branch is when a new line of development is created that diverges from the main line of development&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git configuration&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IuSsRfCw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/snhqjk4bgs31dwm9s2g9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IuSsRfCw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/snhqjk4bgs31dwm9s2g9.png" alt="Alt Text"&gt;&lt;/a&gt;git config steps&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git config --global core.editor your-editor's-config-went-here&lt;/em&gt; to set up your editor&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git commands&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;git init&lt;/strong&gt; - to create a new repository&lt;br&gt;
&lt;strong&gt;git clone&lt;/strong&gt; - to copy an existing repo&lt;br&gt;
&lt;strong&gt;git status&lt;/strong&gt; - to determine the status of our repo&lt;br&gt;
&lt;strong&gt;git show&lt;/strong&gt; - displays info about the given commit. requires the commit's SHA to &lt;br&gt;
               displays its information.&lt;br&gt;
&lt;strong&gt;git log&lt;/strong&gt; - to review a repo's history. displays info about the existing &lt;br&gt;
              commits. git log can be navigated as you would &lt;em&gt;less&lt;/em&gt; in &lt;em&gt;bash&lt;/em&gt; &lt;br&gt;
              with the following:&lt;br&gt;
              &lt;strong&gt;to scroll down&lt;/strong&gt;&lt;br&gt;
              &lt;em&gt;j&lt;/em&gt; or &lt;em&gt;arrow down&lt;/em&gt; to move down one line at a time&lt;br&gt;
              &lt;em&gt;d&lt;/em&gt; to move by half the page screen&lt;br&gt;
              &lt;em&gt;f&lt;/em&gt; to move by a whole page screen&lt;br&gt;
              &lt;strong&gt;to scroll up&lt;/strong&gt;&lt;br&gt;
              &lt;em&gt;k&lt;/em&gt; or &lt;em&gt;arrow up&lt;/em&gt;  to move up one line at a time&lt;br&gt;
              &lt;em&gt;u&lt;/em&gt; to move by half the page screen&lt;br&gt;
              &lt;em&gt;b&lt;/em&gt; to move by a whole page screen&lt;br&gt;
              &lt;strong&gt;to quit&lt;/strong&gt; out of the log, use &lt;em&gt;q&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;git log flags&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;git log --oneline&lt;/em&gt; - displays all the commit history with just short SHAs and the commit message&lt;br&gt;
&lt;em&gt;git log --stats&lt;/em&gt; - lists the files that were changed as well as the number of added or removed files&lt;br&gt;
&lt;em&gt;git log -p or --patch&lt;/em&gt; - displays actual changes made to a file. &lt;em&gt;-w&lt;/em&gt; flag can be added to &lt;br&gt;
               remove whitespaces&lt;br&gt;
&lt;em&gt;git log -p first-seven-characters-in-SHA&lt;/em&gt; - does the same thing &lt;em&gt;git show first-seven-characters-in-SHA&lt;/em&gt; does &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;making commits&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;git add filename&lt;/em&gt; - adds file from the working directory to the staging index. &lt;br&gt;
                    i.e stages the file. &lt;em&gt;git add .&lt;/em&gt; adds all files in the &lt;br&gt;
                    current directory&lt;br&gt;
&lt;em&gt;git rm --cached  * to unstage&lt;br&gt;
*git commit&lt;/em&gt; - takes files from the staging index to the repository. &lt;em&gt;git commit&lt;/em&gt; opens the editor you specified during configuration so you can write your commit message. this can be bypassed using the &lt;em&gt;-m&lt;/em&gt; flag. i.e. &lt;em&gt;git commit -m message&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;it is useful to follow your team's commit message convention. here is udacity's convention &lt;br&gt;
&lt;em&gt;git diff&lt;/em&gt; - displays the difference between two versions of a file. its output &lt;br&gt;
             is exactly like the output of &lt;em&gt;git log -p&lt;/em&gt;. it lets you see changes &lt;br&gt;
             that have been made but that haven't been committed yet&lt;br&gt;
&lt;em&gt;git ignore&lt;/em&gt; - this is not a command. add file &lt;em&gt;.gitignore&lt;/em&gt; to the same directory &lt;br&gt;
               the  &lt;em&gt;.git&lt;/em&gt; folder(your local repo) is located. write the names of &lt;br&gt;
               the files you want to ignore in this file&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;unrelated to topic but USEFUL: GLOBBING&lt;/strong&gt;&lt;br&gt;
for multiple files you want to gitignore, globbing comes in handy. Globbing lets you use special characters to match patterns/characters. In the .gitignore file, you can use the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;blank lines can be used for spacing&lt;/li&gt;
&lt;li&gt;# - marks line as a comment&lt;/li&gt;
&lt;li&gt;* - matches 0 or more characters&lt;/li&gt;
&lt;li&gt;? - matches 1 character&lt;/li&gt;
&lt;li&gt;[abc] - matches a, b, &lt;em&gt;or&lt;/em&gt; c&lt;/li&gt;
&lt;li&gt;** - matches nested directories - a/**/z matches;
                                a/z,
                                a/b/z,
                                a/b/c/z&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So if all of the 50 images are JPEG images in the "samples" folder, we could add the following line to .gitignore to have Git ignore all 50 images.&lt;em&gt;samples/&lt;/em&gt;.jpg*&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git tag&lt;/em&gt; - adds tags to specific commits. a tag is an extra label for a commit &lt;br&gt;
            that can indicate useful information e.g. "this is the beta release"&lt;br&gt;
&lt;em&gt;git tag -a v1.0&lt;/em&gt; - opens up the code editor to write a message for the tag. the &lt;br&gt;
                    &lt;em&gt;-a&lt;/em&gt; flag tells Git to create an annotated flag. If you don't &lt;br&gt;
                    provide the flag (i.e. git tag v1.0) then it'll create what's &lt;br&gt;
                    called a lightweight tag.&lt;br&gt;
Annotated tags are recommended because they include a lot of extra information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the person who made the tag&lt;/li&gt;
&lt;li&gt;the date the tag was made&lt;/li&gt;
&lt;li&gt;a message for the tag
the &lt;em&gt;git tag&lt;/em&gt; command lists all the tags in a repo. &lt;em&gt;git log&lt;/em&gt; displays where in the repo the tags are. Remember that tags are associated with a specific commit
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5hikRHO2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/59nohgr2pt18x94vlemh.png" alt="Alt Text"&gt;git tag; git log
the &lt;em&gt;HEAD&lt;/em&gt; refers to information about a branch
&lt;em&gt;git tag -d v1.0&lt;/em&gt; - deletes the tag named &lt;em&gt;v1.0&lt;/em&gt;. the &lt;em&gt;-d&lt;/em&gt; flag means &lt;em&gt;delete&lt;/em&gt; and &lt;em&gt;--delete&lt;/em&gt; flag can also be used
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZWitXWV---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ncqwh2a4dx8bzrwoef1m.png" alt="Alt Text"&gt;git tag -d
&lt;em&gt;git tag -a v1.0 SHA&lt;/em&gt; - adds a tag to an existing commit. SHA refers to the 1st 
                    seven characters of its SHA&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;git branch&lt;/em&gt; - allows multiple lines of development.  &lt;em&gt;git branch name-of-branch&lt;/em&gt; &lt;br&gt;
               creates a new branch of said name. &lt;em&gt;HEAD&lt;/em&gt; points to the active &lt;br&gt;
               branch. &lt;em&gt;git branch&lt;/em&gt; can also be used to list all branches in the &lt;br&gt;
               repo and to delete a branch. &lt;em&gt;git log --oneline&lt;/em&gt; also displays the &lt;br&gt;
               names of  all the branches in a repo&lt;br&gt;
&lt;em&gt;git branch alt-sidebar-loc 42a69f&lt;/em&gt; - creates a branch &lt;em&gt;alt-sidebar-loc&lt;/em&gt; and &lt;br&gt;
                                      makes &lt;em&gt;HEAD&lt;/em&gt; point to the commit &lt;em&gt;42a69f&lt;/em&gt;&lt;br&gt;
&lt;em&gt;git branch -d branchname&lt;/em&gt; - deletes the branch with the name specified&lt;/p&gt;

&lt;p&gt;Deleting something can be quite nerve-wracking. Don't worry, though. Git won't let you delete a branch if it has commits on it that aren't on any other branch (meaning the commits are unique to the branch that's about to be deleted). If you created the &lt;em&gt;sidebar&lt;/em&gt; branch, added commits to it, and then tried to delete it with the &lt;em&gt;git branch -d sidebar&lt;/em&gt;, Git wouldn't let you delete the branch because you can't delete a branch that you're currently on. If you switched to the master branch and tried to delete the sidebar branch, Git also wouldn't let you do that because those new commits on the sidebar branch would be lost! To force deletion, you need to use a capital D flag &lt;em&gt;git branch -D sidebar&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git checkout&lt;/em&gt; - to switch between different branches and tags. &lt;em&gt;git checkout &lt;br&gt;
                 name-of-branch&lt;/em&gt; switches to the branch of said name to which &lt;br&gt;
                 &lt;em&gt;HEAD&lt;/em&gt; now points&lt;br&gt;
&lt;em&gt;git checkout -b branch-name&lt;/em&gt; - creates branch of said name and switches to it&lt;br&gt;
&lt;em&gt;git checkout -b footer master&lt;/em&gt; - creates a new branch &lt;em&gt;footer&lt;/em&gt; that starts from &lt;br&gt;
                                  the same spot as &lt;em&gt;master&lt;/em&gt;&lt;br&gt;
&lt;em&gt;git log --oneline --graph --all&lt;/em&gt; - &lt;em&gt;--graph&lt;/em&gt; flag adds the bullets and lines to the leftmost part of the output. This shows the actual branching that's happening, &lt;em&gt;--all&lt;/em&gt; flag is what displays all of the branches in the repository&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git merge&lt;/em&gt; - combines changes on different branches. there are two types of &lt;br&gt;
              merging, regular &lt;em&gt;merge&lt;/em&gt; and &lt;em&gt;fast-forward-merge&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XpOqxMIS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ous1ftey8chqip3hdemo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XpOqxMIS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ous1ftey8chqip3hdemo.png" alt="Alt Text"&gt;&lt;/a&gt;footer is ahead of master&lt;br&gt;
&lt;strong&gt;fast-forward-merge occurs&lt;/strong&gt; when for example in the image above,footer is merged into master even though footer is ahead of master.&lt;br&gt;
A way to verbalize fastforward merge, I could say this is - &lt;strong&gt;"I want to merge in the footer branch". That "merge in" is important;&lt;/strong&gt; when a merge is performed, the other branch's changes are brought into the branch that's currently checked out.&lt;/p&gt;

&lt;p&gt;Let me stress that again - When we merge, we're merging some other branch into the current (checked-out) branch. We're not merging two branches into a new branch. We're not merging the current branch into the other branch.&lt;br&gt;
&lt;em&gt;git merge "name-of-branch-to-merge-in"&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bGSnB9gI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cuspgiusi5afv5zr3n89.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bGSnB9gI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cuspgiusi5afv5zr3n89.png" alt="Alt Text"&gt;&lt;/a&gt;footer is merged into master&lt;br&gt;
&lt;em&gt;Remember that making a merge makes a commit.&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;normal git merge&lt;/strong&gt; - requires a commit message because it is merging two &lt;br&gt;
                       divergent branches&lt;br&gt;
When a merge happens, Git will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;look at the branches that it's going to merge&lt;/li&gt;
&lt;li&gt;look back along the branch's history to find a single commit that both branches 
have in their commit history&lt;/li&gt;
&lt;li&gt;combine the lines of code that were changed on the separate branches together
makes a commit to record the merge&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;merge conflicts&lt;/strong&gt; - When a merge fails, it's called a merge conflict. &lt;br&gt;
&lt;strong&gt;what causes a merge conflict&lt;/strong&gt;&lt;br&gt;
Git tracks lines in files. A merge conflict will happen when the exact same line(s) are changed in separate branches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Merge Conflict Indicators Explanation&lt;/strong&gt;&lt;br&gt;
The editor has the following merge conflict indicators:&lt;/p&gt;

&lt;p&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD everything below this line (until the next indicator) shows you what's on the current branch&lt;br&gt;
||||||| merged common ancestors everything below this line (until the next indicator) shows you what the original lines were&lt;br&gt;
======= is the end of the original lines, everything that follows (until the next indicator) is what's on the branch that's being merged in&lt;br&gt;
&lt;em&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/em&gt; heading-update is the ending indicator of what's on the branch that's being merged in (in this case, the heading-update branch)&lt;br&gt;
&lt;strong&gt;resolve merge conflicts&lt;/strong&gt; by deciding on which lines to keep and removing indicators and the commit the merge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;undoing changes&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;git commit --amend&lt;/em&gt; - to alter the most recent commit. useful for if you forget &lt;br&gt;
                       to include a file in the commit for example or had a typo &lt;br&gt;
                       in the commit message.  running git commit --amend will &lt;br&gt;
                       let you provide a new commit message. Your code editor &lt;br&gt;
                       will open up and display the original commit message&lt;br&gt;
&lt;em&gt;git revert SHA&lt;/em&gt; - changes made in the specified commit are erased.&lt;br&gt;
When you tell Git to revert a specific commit, Git takes the changes that were made in commit and does the exact opposite of them. Let's break that down a bit. If a character is added in commit A, if Git reverts commit A, then Git will make a new commit where that character is deleted. It also works the other way where if a character/line is removed, then reverting that commit will add that content back!&lt;br&gt;
This command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;will undo the changes that were made by the provided commit&lt;/li&gt;
&lt;li&gt;creates a new commit to record the change &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;git reset&lt;/em&gt; - to delete commits. commits have to be deleted in order. You've got &lt;br&gt;
              to be careful with Git's resetting capabilities. This is one of the &lt;br&gt;
              few commands that lets you erase commits from the repository. If a &lt;br&gt;
              commit is no longer in the repository, then its content is gone.&lt;br&gt;
To alleviate the stress a bit, Git does keep track of everything for about 30 days before it completely erases anything. To access this content, you'll need to use the &lt;em&gt;git reflog&lt;/em&gt; command. Check out these links for more info:&lt;br&gt;
&lt;a href="https://git-scm.com/docs/git-reflog"&gt;git reflog&lt;/a&gt;&lt;br&gt;
&lt;a href="http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html"&gt;reflog, your safety net&lt;/a&gt;&lt;br&gt;
&lt;em&gt;git reset --hard HEAD^&lt;/em&gt; - to undo changes. the ^ character is known as a &lt;br&gt;
                           "Relative Commit Reference" and indicates "the parent &lt;br&gt;
                            commit"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Relative Commit Reference&lt;/strong&gt;&lt;br&gt;
so we already know we can reference commits by their tags, SHA, branches and the special &lt;em&gt;HEAD&lt;/em&gt; pointer. Sometimes that's not enough, though. There will be times when you'll want to reference a commit relative to another commit. For example, there will be times where you'll want to tell Git about the commit that's one before the current commit...or two before the current commit. There are special characters called "Ancestry References" that we can use to tell Git about these relative references. Those characters are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;^&lt;/em&gt; - indicates the parent commit&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;~&lt;/em&gt; - indicates the first parent commit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's how we can refer to previous commits:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y7eyrbdM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5tkqi03nt8cxljfc7hxo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y7eyrbdM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5tkqi03nt8cxljfc7hxo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main difference between the &lt;em&gt;^&lt;/em&gt; and the &lt;em&gt;~&lt;/em&gt; is when a commit is created from a merge. A merge commit has two parents. With a merge commit, the &lt;em&gt;^&lt;/em&gt; reference is used to indicate the first parent of the commit while &lt;em&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/em&gt; indicates the second parent. The first parent is the branch you were on when you ran git merge while the second parent is the branch that was merged in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l64cjtTY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7ga2um31052phwyudelt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l64cjtTY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7ga2um31052phwyudelt.png" alt="Alt Text"&gt;&lt;/a&gt;an example --graph --all&lt;/p&gt;

&lt;p&gt;from the above diagram: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---VES45Tr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8t7wzklh6bulo3w8mdws.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---VES45Tr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8t7wzklh6bulo3w8mdws.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;git reset flags&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;--mixed&lt;/em&gt;&lt;br&gt;
&lt;em&gt;--soft&lt;/em&gt;&lt;br&gt;
&lt;em&gt;--hard&lt;/em&gt;&lt;br&gt;
looking at &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EZ3bK0FL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dz3m9x4i2op2auv4jqfn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EZ3bK0FL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dz3m9x4i2op2auv4jqfn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git reset --mixed HEAD^&lt;/em&gt; - will take the changes made in commit 9ec05ca and move them to the working directory.&lt;br&gt;
*If you created the backup branch prior to resetting anything, then you can easily get back to having the master branch point to the same commit as the backup branch. You'll just need to:&lt;/p&gt;

&lt;p&gt;remove the uncommitted changes from the working directory&lt;br&gt;
merge backup into master (which will cause a Fast-forward merge and move master up to the same point as backup)*&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git reset --soft HEAD^&lt;/em&gt; - will take the changes made in commit 9ec05ca and move &lt;br&gt;
                           them directly to the Staging Index.&lt;br&gt;
&lt;em&gt;git reset --hard HEAD^&lt;/em&gt; - will take the changes made in commit 9ec05ca and &lt;br&gt;
                           erases them&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;working with remotes&lt;/strong&gt;&lt;br&gt;
this part touches on using git to collaborate with a team with remote repos. there are many tools/services for hosting version control repos e.g. github, bitbucket, gitlab etc&lt;br&gt;
continuing on with the git commands, this time to manage the remote repos:&lt;br&gt;
&lt;em&gt;git remote&lt;/em&gt; - to manage remote repository. you can have multiple remote repos &lt;br&gt;
               for one local repo. The output of git remote is just the word &lt;br&gt;
               &lt;em&gt;origin&lt;/em&gt;. &lt;br&gt;
The word "origin", here, is referred to as a "shortname". A shortname is just a short and easy way to refer to the location of the remote repository. A shortname is local to the current repository (as in, your local repository). The word "origin" is the defacto name that's used to refer to the main remote repository. It's possible to rename this to something else, but typically it's left as "origin".&lt;br&gt;
&lt;em&gt;git remote -v&lt;/em&gt; - shows the full path of a remote repository&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MPQkaoax--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xi8m1bxqs250dhaokyps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MPQkaoax--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xi8m1bxqs250dhaokyps.png" alt="Alt Text"&gt;&lt;/a&gt;git remote -v&lt;br&gt;
&lt;em&gt;git remote add origin URL&lt;/em&gt; - to create a connection between a local repo and a &lt;br&gt;
                              remote github repo&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git push&lt;/em&gt; - to send changes up to the remote&lt;br&gt;
&lt;em&gt;git push *remote-shortname&lt;/em&gt; &lt;em&gt;branch&lt;/em&gt; * - To send local commits to a remote &lt;br&gt;
                                         repository you need to use the git push &lt;br&gt;
                                         command. You provide the remote short &lt;br&gt;
                                         name and then you supply the name of the &lt;br&gt;
                                         branch that contains the commits you &lt;br&gt;
                                         want to push. as in &lt;em&gt;git push origin &lt;br&gt;
                                         master&lt;/em&gt;&lt;br&gt;
&lt;em&gt;git push -u origin master&lt;/em&gt; - &lt;em&gt;-u&lt;/em&gt; flag stands upstream. &lt;em&gt;--set-upstream&lt;/em&gt; can &lt;br&gt;
                              also be used&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6KTfhL8W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/18rw0dwt8tfafz69p7as.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6KTfhL8W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/18rw0dwt8tfafz69p7as.png" alt="Alt Text"&gt;&lt;/a&gt;notice the origin/master&lt;br&gt;
the branch that appears in the local repository is actually tracking a branch in the remote repository e.g. &lt;em&gt;origin/master&lt;/em&gt; in the local repository is called a tracking branch because it's tracking the progress of the master branch on the remote repository that has the shortname "origin"&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git pull&lt;/em&gt; - to retrieve updates from the remote repository. &lt;em&gt;git push&lt;/em&gt; will sync &lt;br&gt;
             the remote repository with the local repository. To do the opposite &lt;br&gt;
             &lt;em&gt;to sync the local with the remote&lt;/em&gt;, we need to use git pull&lt;br&gt;
The format for git pull is very similar to git push - you provided the shortname for the remote repository and then the name of the branch you want to pull in the commits&lt;br&gt;
&lt;em&gt;git pull origin master&lt;/em&gt;&lt;br&gt;
If you don't want to automatically merge the local branch with the tracking branch then you wouldn't use &lt;em&gt;git pull&lt;/em&gt; you would use a different command called &lt;em&gt;git fetch&lt;/em&gt;. You might want to do this if there are commits on the repository that you don't have but there are also commits on the local repository that the remote one doesn't have either&lt;/p&gt;

&lt;p&gt;&lt;em&gt;git fetch&lt;/em&gt; - Git fetch is used to retrieve commits from a remote repository's &lt;br&gt;
              branch but it does not automatically merge the local branch with &lt;br&gt;
              the remote tracking branch after those commits have been received&lt;br&gt;
&lt;em&gt;git fetch origin master&lt;/em&gt;&lt;br&gt;
When git fetch is run, the following things happen:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the commit(s) on the remote branch are copied to the local repository&lt;/li&gt;
&lt;li&gt;the local tracking branch (e.g. origin/master) is moved to point to the most 
recent commit
The important thing to note is that the local branch does not change at all.
You can think of &lt;em&gt;git fetch&lt;/em&gt; as half of a &lt;em&gt;git pull&lt;/em&gt;. The other half of &lt;em&gt;git pull&lt;/em&gt; is the merging aspect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;other git log commands&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;git shortlog&lt;/em&gt; - to group commits by author&lt;br&gt;
&lt;em&gt;git log --author="author name"&lt;/em&gt; - filters commits by author name with the &lt;em&gt;-- &lt;br&gt;
                                   author&lt;/em&gt; flag&lt;br&gt;
&lt;em&gt;git log --grep="commit message"&lt;/em&gt; - &lt;em&gt;--grep&lt;/em&gt; flag is used to filter commits by &lt;br&gt;
                                    commit message. e.g &lt;em&gt;git log --grep="border &lt;br&gt;
                                    radius issue in Safari"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;contributing to another person's project is done by forking and creating pull requests.&lt;br&gt;
&lt;em&gt;A pull request&lt;/em&gt; is a request to the original or source repository's maintainer to include changes in their project that you made in your fork of their project. You are requesting that they pull in changes you've made&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CONTRIBUTING.md&lt;/strong&gt;&lt;br&gt;
The name of the `CONTRIBUTING.md file is typically written in all caps so that it's easily seen. As you could probably tell by its name, this file lists out the information you should follow to contribute to the project.&lt;/p&gt;

&lt;p&gt;The best way to organize the set of commits/changes you want to contribute back to the project is to put them all on a &lt;em&gt;topic branch&lt;/em&gt;. Now what do I mean by a topic branch? Unlike the master branch which is the default branch that holds all of the commits for your entire project, a topic branch host commits for just a single concept or single area of change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;best practices for contributing to another person's project&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write Descriptive Commit Messages&lt;/li&gt;
&lt;li&gt;Create Small, Focused Commits&lt;/li&gt;
&lt;li&gt;Update The README&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;staying in sync with source project&lt;/strong&gt;&lt;br&gt;
using &lt;em&gt;stars&lt;/em&gt; and &lt;em&gt;watching&lt;/em&gt; features available on the repo page.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HxM-Vpvc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sw88iv5l8doc5zpkgb02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HxM-Vpvc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sw88iv5l8doc5zpkgb02.png" alt="Alt Text"&gt;&lt;/a&gt;stars feature in github&lt;/p&gt;

&lt;p&gt;If you need to keep up with a project's changes and want to be notified of when things change, GitHub offers a &lt;em&gt;Watch&lt;/em&gt; feature:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CLrUZqqH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/80cm4new0wlkvsuj76wc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CLrUZqqH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/80cm4new0wlkvsuj76wc.png" alt="Alt Text"&gt;&lt;/a&gt;watch feature&lt;/p&gt;

&lt;p&gt;If you're working on a repository quite often, then I'd suggest setting the watch setting to "Watching". This way GitHub will notify you whenever anything happens with the repository like people pushing changes to the repository, new issues being created, or comments being added to existing issues.&lt;/p&gt;

&lt;p&gt;Now lets say that you're watching it and you get notified that some commits have been pushed to the original, source repository. How do you go about getting those changes into your fork of the repository?&lt;br&gt;
well, we can create a connection between our local repo and the original repo by creating a shortname typically &lt;em&gt;upstream&lt;/em&gt; to represent the original remote repo.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;git remote add upstream url-of-original-repo*
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c6fWWhl7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xnsw4ersnfytqyelh97d.png" alt="Alt Text"&gt;origin really means your own repo while upstream really means source-repo. their names can be changed as seen here
&lt;em&gt;git remote rename current-remote-name new-remote-name&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;to get upstream changes&lt;/strong&gt;&lt;br&gt;
run a &lt;em&gt;git fetch&lt;/em&gt;. &lt;em&gt;git fetch upstream master&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recap of getting upstream changes&lt;/strong&gt;&lt;br&gt;
When working with a project that you've forked. The original project's maintainer will continue adding changes to their project. You'll want to keep your fork of their project in sync with theirs so that you can include any changes they make.&lt;br&gt;
To get commits from a source repository into your forked repository on GitHub you need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;get the cloneable URL of the source repository&lt;/li&gt;
&lt;li&gt;create a new remote with the git remote add command&lt;/li&gt;
&lt;li&gt;use the shortname upstream to point to the source repository&lt;/li&gt;
&lt;li&gt;provide the URL of the source repository&lt;/li&gt;
&lt;li&gt;fetch the new upstream remote&lt;/li&gt;
&lt;li&gt;merge the upstream's branch into a local branch&lt;/li&gt;
&lt;li&gt;push the newly updated local branch to your origin rep&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;git rebase&lt;/em&gt; - squashing commits into one commit. The &lt;em&gt;git rebase&lt;/em&gt; command will &lt;br&gt;
               move commits to have a new &lt;em&gt;base&lt;/em&gt;.&lt;br&gt;
&lt;em&gt;git rebase -i HEAD~3&lt;/em&gt; - we're telling Git to use HEAD~3 as the base where all of &lt;br&gt;
                        the other commits &lt;em&gt;HEAD~2&lt;/em&gt;, &lt;em&gt;HEAD~1&lt;/em&gt;, and &lt;em&gt;HEAD&lt;/em&gt; will &lt;br&gt;
                        connect to. The &lt;em&gt;-i&lt;/em&gt; flag in the command stands for &lt;br&gt;
                        "interactive". You can perform a rebase in a non- &lt;br&gt;
                         interactive mode&lt;br&gt;
Using &lt;em&gt;git rebase&lt;/em&gt; creates a new commit with a new SHA. When I tried using git push to send this commit up to GitHub, GitHub knew that accepting the push would erase the three separate commits, so it rejected it. &lt;em&gt;git push -f&lt;/em&gt; is used to force push&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rebase Commands&lt;/strong&gt;&lt;br&gt;
Let's take another look at the different commands that you can do with git rebase:&lt;/p&gt;

&lt;p&gt;use p or pick – to keep the commit as is&lt;br&gt;
use r or reword – to keep the commit's content but alter the commit message&lt;br&gt;
use e or edit – to keep the commit's content but stop before committing so that you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;add new content or files&lt;/li&gt;
&lt;li&gt;remove content or files&lt;/li&gt;
&lt;li&gt;alter the content that was going to be committed&lt;/li&gt;
&lt;li&gt;use &lt;em&gt;s&lt;/em&gt; or squash – to combine this commit's changes into the previous commit 
the i.e. commit above it in the list&lt;/li&gt;
&lt;li&gt;use &lt;em&gt;f&lt;/em&gt; or fixup – to combine this commit's change into the previous one but 
drop the commit message&lt;/li&gt;
&lt;li&gt;use &lt;em&gt;x&lt;/em&gt; or &lt;em&gt;exec&lt;/em&gt; – to run a shell command&lt;/li&gt;
&lt;li&gt;use &lt;em&gt;d&lt;/em&gt; or &lt;em&gt;drop&lt;/em&gt; – to delete the commit&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>versioncontrol</category>
      <category>git</category>
      <category>udacity</category>
      <category>cloudscholarship</category>
    </item>
    <item>
      <title>working with a SHELL</title>
      <dc:creator>sekinat</dc:creator>
      <pubDate>Tue, 18 Feb 2020 11:39:46 +0000</pubDate>
      <link>https://dev.to/sekinat95/working-with-a-shell-3b9k</link>
      <guid>https://dev.to/sekinat95/working-with-a-shell-3b9k</guid>
      <description>&lt;p&gt;A shell is simply the outermost layer of an operating system. It's designed to provide a way for you to interact with the tools and services that your operating system provides. There are two types: &lt;strong&gt;graphic shell&lt;/strong&gt; and &lt;strong&gt;text shell&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;windows start menu&lt;/em&gt;, &lt;em&gt;mac finder&lt;/em&gt; are graphic shells where you interact with the operating system through things like windows and buttons. They are also called the GUI or Graphical User Interface.&lt;br&gt;
Bash shell is a text shell used by unix systems by default (linux and mac). Its also called command line interface or CLI. Text shells allows ou to enter text commands to perform tasks instead of clicking on buttons&lt;/p&gt;

&lt;p&gt;&lt;em&gt;echo&lt;/em&gt;&lt;br&gt;
to print something on the cli&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3FfMUQbD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wdhnwwa0lji3mvn6ia1u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3FfMUQbD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wdhnwwa0lji3mvn6ia1u.png" alt="echo"&gt;&lt;/a&gt;echo&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;to get the value assigned to a variable&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iNZfUDEH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jouk6hw9z9v6fxf3ajvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iNZfUDEH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jouk6hw9z9v6fxf3ajvs.png" alt="get the value assigned to a variable"&gt;&lt;/a&gt;get the value assigned to a variable&lt;br&gt;
notice there's no spaces around '=' because bash deplays an error &lt;em&gt;x command not found&lt;/em&gt;&lt;br&gt;
In e.g Python, we could optionally include those spaces or not, and it worked fine either way. But in BASH, x=100 and x = 100 mean different things.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;navigating directories&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;ls&lt;/em&gt; to list the content of the current directory in a shell&lt;br&gt;
&lt;em&gt;ls name-of-direcotry&lt;/em&gt; to list the content of another directory&lt;br&gt;
&lt;em&gt;cd&lt;/em&gt; change directory&lt;br&gt;
&lt;em&gt;cd ..&lt;/em&gt; go back one directory&lt;br&gt;
&lt;em&gt;;&lt;/em&gt; lets yo run two commands in one line&lt;br&gt;
&lt;em&gt;ls ..&lt;/em&gt; list the contents of parent directory&lt;br&gt;
&lt;em&gt;pwd&lt;/em&gt; print working directory&lt;br&gt;
&lt;em&gt;..&lt;/em&gt; parent directory&lt;br&gt;
&lt;em&gt;.&lt;/em&gt; current directory&lt;br&gt;
&lt;em&gt;~&lt;/em&gt; home directory&lt;/p&gt;

&lt;p&gt;unix uses forward slash '/' to separate directories while windows cmd uses backslash '\' (wastemen)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;absolute v relative path&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;relative&lt;/em&gt;&lt;br&gt;
when you specify a path relative to the current location &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_Fx50WWT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/up32d4pbqz6znu1nvrno.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_Fx50WWT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/up32d4pbqz6znu1nvrno.png" alt="Alt Text"&gt;&lt;/a&gt;relative&lt;br&gt;
&lt;em&gt;absolute&lt;/em&gt;&lt;br&gt;
when the path specified starts from the home directory or 'c' directory in windows&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bY3Gv0kp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3zod8jxllll8kb119hj7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bY3Gv0kp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3zod8jxllll8kb119hj7.png" alt="Alt Text"&gt;&lt;/a&gt;absolute&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;options&lt;/strong&gt;&lt;br&gt;
options or flags turn on extra behaviour or extra features.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;ls -l&lt;/em&gt;  -l stands for &lt;em&gt;long&lt;/em&gt; .longer more detailed&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ar7MhVMq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0aul6stpo2jbstbmlrbg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ar7MhVMq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0aul6stpo2jbstbmlrbg.png" alt="Alt Text"&gt;&lt;/a&gt;ls -l&lt;/p&gt;

&lt;p&gt;&lt;em&gt;.pdf&lt;/em&gt; all pdfs in a directory&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YoRB-tNJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/awnuujh7rrilodzkqp6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YoRB-tNJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/awnuujh7rrilodzkqp6f.png" alt="Alt Text"&gt;&lt;/a&gt;ls &lt;em&gt;.pdf&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;ls *poem&lt;/em&gt; * lists all files whose names containes the word poem&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;organising your files&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;mkdir&lt;/em&gt; make a new directory&lt;br&gt;
&lt;em&gt;mv&lt;/em&gt; move file: &lt;strong&gt;mv&lt;/strong&gt; &lt;em&gt;name of file&lt;/em&gt; &lt;em&gt;destination you want it to go&lt;/em&gt; eg &lt;strong&gt;mv&lt;/strong&gt; &lt;em&gt;.epub /Documents/Books&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;bash commands cant be undone?&lt;/em&gt; : they can but I pray I never have to is all I'm saying on this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;downloading files from the web: curl&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;curl&lt;/em&gt; to download files. &lt;em&gt;c url&lt;/em&gt; ==&amp;gt; &lt;em&gt;see url&lt;/em&gt;&lt;br&gt;
&lt;em&gt;curl 'url'&lt;/em&gt;&lt;br&gt;
If you add the -L option to curl, it will first follow any redirects, and then download the file from wherever the redirects ultimately go.&lt;br&gt;
&lt;em&gt;curl -L 'url'&lt;/em&gt; displays source code to the actual url homepage to the terminal&lt;br&gt;
&lt;em&gt;curl -o 'file name' -L 'url'&lt;/em&gt; to save the source code to a file&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;viewing files&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;cat&lt;/em&gt; displays the full content of the file&lt;br&gt;
&lt;em&gt;less&lt;/em&gt; shows less of the file at once. you can use the arrow keys to navigate, 'q' to &lt;strong&gt;quit&lt;/strong&gt;, '/' to &lt;strong&gt;search&lt;/strong&gt;, 'b' or &lt;em&gt;up&lt;/em&gt; arrow to &lt;strong&gt;scroll up&lt;/strong&gt;, &lt;em&gt;spacebar&lt;/em&gt; or &lt;em&gt;down&lt;/em&gt; arrow to &lt;strong&gt;scroll down&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;/zebra&lt;/em&gt; searches for the word 'zebra'&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;removing things&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;rm&lt;/em&gt; remove file. deletes permanently. &lt;em&gt;-i&lt;/em&gt; flag prompts you for every file you want to remove. &lt;br&gt;
&lt;em&gt;rmdir&lt;/em&gt; remove directory. it only removes an empty directory&lt;/p&gt;

</description>
      <category>bash</category>
      <category>udacity</category>
      <category>bertelsmanncloudscholarship</category>
    </item>
  </channel>
</rss>
