about summary refs log tree commit diff stats
path: root/dev/git/work.html
diff options
context:
space:
mode:
Diffstat (limited to 'dev/git/work.html')
-rw-r--r--dev/git/work.html69
1 files changed, 35 insertions, 34 deletions
diff --git a/dev/git/work.html b/dev/git/work.html
index 3111eaf..724df1c 100644
--- a/dev/git/work.html
+++ b/dev/git/work.html
@@ -10,58 +10,58 @@
 
     <h1>1. Work</h1>
 
-    <p>Git is very easy to use and very useful to keep information in text or other formats. To start using just go to a directory where you will test git, add some files and;
+    <p id="init">Git is very easy to use and very useful to keep information in text or other formats. To start using just go to a directory where you will test git, add some files and;
 
     <pre>
-$ git init
+    $ git init
     </pre>
 
-    <p>This initiates git directory and configuration files for this repository, you can see new directory ".git/". The next command says the status of your working directory, since no files have been added it will report "untracked files";</p>
+    <p id="status">This initiates git directory and configuration files for this repository, you can see new directory ".git/". The next command says the status of your working directory, since no files have been added it will report "untracked files";</p>
 
     <pre>
-$ git status
+    $ git status
     </pre>
 
-    <p>Add all files to start tracking them;</p>
+    <p id="add">Add all files to start tracking them;</p>
 
     <pre>
-$ git add .
+    $ git add .
     </pre>
 
     <p>Run again git status, it should report that new files have been added;</p>
 
     <pre>
-$ git status
+    $ git status
     </pre>
 
-    <p>If you change any file it will report that the file have been changed at this moment, new changes can be added to current state of the files for the next commit. To commit;</p>
+    <p id="commit">If you change any file it will report that the file have been changed at this moment, new changes can be added to current state of the files for the next commit. To commit;</p>
 
     <pre>
-$ git commit -m "initial commit"
+    $ git commit -m "initial commit"
     </pre>
 
     <h2 id="local">2.1. Local workflow</h2>
 
-    <p>Check ~/.bashrc for glog alias, help to check branches and their commit history;</p>
+    <p id="log">Check ~/.bashrc for glog alias, help to check branches and their commit history;</p>
 
     <pre>
-# Git log
-glog () {
-    git log --stat --decorate
-}
-# Git graph log
-gloga () {
-    git log --graph --abbrev-commit --decorate --date=relative --all
-}
+    # Git log
+    glog () {
+        git log --stat --decorate
+    }
+    # Git graph log
+    gloga () {
+        git log --graph --abbrev-commit --decorate --date=relative --all
+    }
     </pre>
 
-    <p>Mark all deleted to commit;</p>
+    <p id="ls-files">Mark all deleted to commit;</p>
 
     <pre>
     $ git ls-files --deleted -z | xargs -0 git rm
     </pre>
 
-    <p>Query last commit that affected current file path</p>
+    <p id="rev-list">Query last commit that affected current file path</p>
 
     <pre>
     $ git rev-list -n 1 HEAD -- .
@@ -69,7 +69,7 @@ gloga () {
     $ git diff --name-status f000 path/to/file
     </pre>
 
-    <p>Undo a file to specific commit</p>
+    <p id="checkout">Undo a file to specific commit</p>
 
     <pre>
     $ git checkout f000^ -- path/to/file
@@ -82,7 +82,7 @@ gloga () {
     $ git rebase -i oldest_commit_to_rewrite
     </pre>
 
-    <p>Undo last commit;</p>
+    <p id="reset">Undo last commit;</p>
 
     <pre>
     $ git reset --soft HEAD~1
@@ -90,7 +90,7 @@ gloga () {
 
     <h2 id="logdiff">2.2. Logs, diff commits</h2>
 
-    <p>Create patch files to target branch/tag/ref;</p>
+    <p id="format-patch">Create patch files to target branch/tag/ref;</p>
 
     <pre>
     $ git format-patch --no-prefix software-v0.0.1
@@ -110,37 +110,37 @@ gloga () {
     $ git remote add newremotename https://machine.example.org/repo.git
     </pre>
 
-    <p>Update all branches with remote;</p>
+    <p>Update local branches removed on remote set automatically;</p>
 
     <pre>
-    $ git fetch --all
-    $ git pull --all
+    $ git config --global fetch.prune true
     </pre>
 
-    <p>If you want to track all remotes run this line
-    and then the commands mentioned above;</p>
+    <p>This will prune on fetch or you can keep it manually;</p>
 
     <pre>
-    $ for remote in `git branch -r`; do git branch --track ${remote#origin/} $remote; done
+    $ git remote prune origin
     </pre>
 
-    <p>Future updates;</p>
+    <p id="fetch">Update all branches with remote;</p>
 
     <pre>
     $ git fetch --all
     $ git pull --all
     </pre>
 
-    <p>Update local branches removed on remote set;</p>
+    <p>If you want to track all remotes run this line
+    and then the commands mentioned above;</p>
 
     <pre>
-    $ git config --global fetch.prune true
+    $ for remote in `git branch -r`; do git branch --track ${remote#origin/} $remote; done
     </pre>
 
-    <p>This will prune on fetch or you can keep it manually;</p>
+    <p>Future updates;</p>
 
     <pre>
-    $ git remote prune origin
+    $ git fetch --all
+    $ git pull --all
     </pre>
 
     <p>When using gitolite as remote, check following documentation;</p>
@@ -161,6 +161,7 @@ gloga () {
     </ul>
 
     <a href="index.html">Git Index</a>
+
     <p>This is part of the Hive System Documentation.
     Copyright (C) 2019
     Hive Team.