This shows you the differences between two versions of the page.
| git [2021/06/11 05:40] – created vissie | git [2021/06/11 05:43] (current) – vissie | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== Server ===== | ===== Server ===== | ||
| < | < | ||
| - | git config --global user.email johndoe@example.com | + | git config --global user.email johndoe@example.com |
| - | git config --global core.editor vim | + | git config --global core.editor vim |
| - | git config --list | + | git config --list |
| - | mkdir ~/ | + | mkdir ~/ |
| - | cd ~/ | + | cd ~/ |
| - | git init --bare</ | + | git init --bare</ |
| ===== Client ===== | ===== Client ===== | ||
| < | < | ||
| - | ssh-copy-id -p22 user@123.45.56.78 | + | ssh-copy-id -p22 user@123.45.56.78 |
| - | git config --global user.name "Local User" | + | git config --global user.name "Local User" |
| - | git config --global user.email johndoe@example.com | + | git config --global user.email johndoe@example.com |
| - | git config --global core.editor vim | + | git config --global core.editor vim |
| - | git config --list | + | git config --list |
| - | + | cd ~/project | |
| - | cd ~/project | + | git init |
| - | git init | + | vim my_file.txt |
| - | vim my_file.txt | + | git add . |
| - | git add . | + | git commit |
| - | git commit | + | git remote add MyProject ssh:// |
| - | git remote add MyProject ssh:// | + | git push -u MyProject master |
| - | git push -u MyProject master | + | git status</ |
| - | git status</ | + | |
| ===== Add some color ===== | ===== Add some color ===== | ||
| Line 35: | Line 34: | ||
| ===== Clone a repo ===== | ===== Clone a repo ===== | ||
| < | < | ||
| - | git clone ssh:// | + | git clone ssh:// |
| ===== See the changes ===== | ===== See the changes ===== | ||
| Line 42: | Line 41: | ||
| You can also add the following to yout git config file: | You can also add the following to yout git config file: | ||
| - | vim ~/ | + | vim ~/ |
| - | | + | <sxh bash; gutter: false> |
| - | date = relative | + | [log] |
| - | | + | |
| - | pretty = format: | + | [format] |
| - | + | | |
| - | if you need branch info, try adding %C(yellow)%d%Creset : | + | #if you need branch info, try adding %C(yellow)%d%Creset : |
| - | | + | pretty = format: |
| + | </ | ||
| ====== Using GIT ====== | ====== Using GIT ====== | ||
| ===== Get started ===== | ===== Get started ===== | ||
| - | apt-get install git git-core | + | < |
| Example for starting a local repo based on what you have from github: | Example for starting a local repo based on what you have from github: | ||
| - | git clone https:// | + | < |
| - | cd emerald | + | cd emerald |
| - | ls -l | + | ls -l |
| - | | + | ./configure --options |
| - | | + | make |
| - | sudo make install | + | sudo make install</ |
| ===== To see the status of the repo, do: ===== | ===== To see the status of the repo, do: ===== | ||
| - | git status | + | < |
| Example for syncing your local repo to more recent changes on github: | Example for syncing your local repo to more recent changes on github: | ||
| - | git pull | + | < |
| To pull a specific branch: | To pull a specific branch: | ||
| - | git clone -b colors https:// | + | < |
| If you're building directly from the git repository, make sure you have perl (or rather, pod2man), pkg-config and GNU autoconf/ | If you're building directly from the git repository, make sure you have perl (or rather, pod2man), pkg-config and GNU autoconf/ | ||
| - | sudo apt-get install autoconf automake | + | < |
| - | | + | autoreconf -i</ |