diff options
Diffstat (limited to 'dev/git.html')
-rw-r--r-- | dev/git.html | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/dev/git.html b/dev/git.html index 5d65b32..de11de0 100644 --- a/dev/git.html +++ b/dev/git.html @@ -252,7 +252,16 @@ $ git -D h-1.2.2 </pre> - <h2 id="local">Local Workflow</h2> + <h2 id="local">2. Local Workflow</h2> + + <h3 id="working">2.1. Working area</h3> + + <p>Mark all deleted to commit;</p> + + <pre> + $ git ls-files --deleted -z | xargs -0 git rm + </pre> + <p>Mark all deleted to commit;</p> @@ -260,6 +269,8 @@ $ git ls-files --deleted -z | xargs -0 git rm </pre> + <h3 id="logdiff">2.2. Logs and commits</h3> + <p>Last commit that affected current path</p> <pre> @@ -274,6 +285,42 @@ $ git checkout f000^ -- path/to/file </pre> + <h3 id="remote">2.3. Working with remotes</h3> + + <p>Update all branches with remote;</p> + + <pre> + $ git fetch --all + $ git pull --all + </pre> + + <p>If you want to track all remotes run this line + and then the commands mentioned above;</p> + + <pre> + $ for remote in `git branch -r`; do git branch --track ${remote#origin/} $remote; done + </pre> + + <p>Future updates;</p> + + <pre> + $ git fetch --all + $ git pull --all + </pre> + + <p>Update local branches removed on remote set;</p> + + <pre> + $ git config --global fetch.prune true + </pre> + + + <p>This will prune on fetch or you can keep it manually;</p> + + <pre> + $ git remote prune origin + </pre> + <a href="index.html">Development Index</a> <p>This is part of the c9-doc Manual. Copyright (C) 2016 |