Git Commands

by secretgspot

HTML

<table>
    <thead>
        <tr>
            <th colspan="2">Git Commands</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th>Initialize a local Git repository</th>
            <td>git init</td>
        </tr>
        <tr>
            <th>Check status</th>
            <td>git status</td>
        </tr>
        <tr>
            <th>Add a file to the staging area</th>
            <td>git add [file-name.txt]</td>
        </tr>
        <tr>
            <th>Commit changes</th>
            <td>git commit -m "[commit message]"</td>
        </tr>
        <tr>
            <th>View changes</th>
            <td>git log</td>
        </tr>
        <tr>
            <th>View changes (detailed)</th>
            <td>git log --summary</td>
        </tr>
        <tr>
            <th>Add a remote repository</th>
            <td>git remote add origin [email protected]/joshnh/[repository-name].git</td>
        </tr>
        <tr>
            <th>Set a repository's origin branch to SSH</th>
            <td>git remote set-url origin ssh://[email protected]/joshnh/[repository-name].git</td>
        </tr>
        <tr>
            <th>Push changes to remote repository (first time)</th>
            <td>git push -u origin master</td>
        </tr>
        <tr>
            <th>Push changes to remote repository (subsequent times)</th>
            <td>git push</td>
        </tr>
        <tr>
            <th>Pull changes from remote repository</th>
            <td>git pull origin master</td>
        </tr>
        <tr>
            <th>Create a local copy of a remote repository</th>
            <td>git clone ssh://[email protected]/joshnh/[repository-name].git</td>
        </tr>
    </tbody>
</table>

CSS

body {
    background-color: #f6f6f6;
}
table {
    background-color: #fff;
    border-collapse: collapse;
    box-shadow: 0 .1em .25em hsla(0,0%,0%,.25);
    color: #333;
    font: 1em/1.5 monospace;
    margin: 3em auto;
}
thead th {
    background-color: #ddd;
    font-size: 2em;
    letter-spacing: .1em;
    line-height: .75em;
    text-align: center;
    text-transform: uppercase;
}
tbody tr:nth-child(2n) {
    background-color: #eee;
}
td,
th {
    border: 1px solid #aaa;
    padding: .75em 1.5em;
    text-align: left;
}
th {
    font-family: sans-serif;
    font-weight: bold;
}