diff options
Diffstat (limited to 'dev/git/index.html')
-rw-r--r-- | dev/git/index.html | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/dev/git/index.html b/dev/git/index.html index 4e61822..e23e2a0 100644 --- a/dev/git/index.html +++ b/dev/git/index.html @@ -295,39 +295,39 @@ $ git ls-files --deleted -z | xargs -0 git rm </pre> - - <p>Mark all deleted to commit;</p> + <p>Query last commit that affected current file path</p> <pre> - $ git ls-files --deleted -z | xargs -0 git rm + $ git rev-list -n 1 HEAD -- . + $ git show f000 path/to/file + $ git diff --name-status f000 path/to/file </pre> - <h3 id="logdiff">2.2. Logs, diff commits</h3> - - <p>Create patch files to target branch/tag/ref;</p> + <p>Undo a file to specific commit</p> <pre> - $ git format-patch --no-prefix software-v0.0.1 + $ git checkout f000^ -- path/to/file </pre> - <p>Same using diff tool;</p> + <p>Join multiple commits into single one;</p> <pre> - $ diff orig file > file.patch + $ git log --oneline + $ git rebase -i oldest_commit_to_rewrite </pre> - <p>Query last commit that affected current file path</p> + <h3 id="logdiff">2.2. Logs, diff commits</h3> + + <p>Create patch files to target branch/tag/ref;</p> <pre> - $ git rev-list -n 1 HEAD -- . - $ git show f000 path/to/file - $ git diff --name-status f000 path/to/file + $ git format-patch --no-prefix software-v0.0.1 </pre> - <p>Undo a file to specific commit</p> + <p>Same using diff command;</p> <pre> - $ git checkout f000^ -- path/to/file + $ diff orig file > file.patch </pre> <h3 id="remote">2.3. Working with remotes</h3> @@ -335,7 +335,7 @@ <p>Adding a new remote;</p> <pre> - $ git remote add newremotename https://github.com/user/repo.git + $ git remote add newremotename https://machine.example.org/repo.git </pre> <p>Update all branches with remote;</p> @@ -365,7 +365,6 @@ $ git config --global fetch.prune true </pre> - <p>This will prune on fetch or you can keep it manually;</p> <pre> @@ -375,7 +374,7 @@ <a href="../index.html">Development Index</a> <p>This is part of the Hive System Documentation. Copyright (C) 2018 - c9 Team. + Hive Team. See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a> for copying conditions.</p> </body> |