[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 96d4d3b: Improve some git instructions

From: Greg Chicares
Subject: [lmi-commits] [lmi] master 96d4d3b: Improve some git instructions
Date: Sun, 6 Dec 2020 20:17:20 -0500 (EST)

branch: master
commit 96d4d3bb0dd1bf8aef21bad8c91157f67cfeacb1
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Improve some git instructions
    Most importantly, prefer 'git switch' to the confusingly overloaded
    'git branch'.
 gwc/develop1.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gwc/develop1.txt b/gwc/develop1.txt
index 4c5a79c..a934d65 100644
--- a/gwc/develop1.txt
+++ b/gwc/develop1.txt
@@ -120,6 +120,18 @@ git reset --keep origin/master
 git push --set-upstream origin odd/foo
   # ...and, if that branch is (later) to be rebased on 'master', be
   # sure to use either '--no-fork-point' or an explicit branch name.
+  #
+  # Alternatively, instead of the above commands, use the following:
+  # ...create and switch to a new branch (for unpushed commits)...
+git switch --create odd/foo
+  # ...add any further commits...
+git commit whatever.cpp
+  # ...specify upstream on first push, as above...
+git push --set-upstream origin odd/foo
+  # ...then awaken from the dream...
+git switch master
+  # ...and forget it, if desired, as above...
+git reset --keep origin/master
   # (to copy to a subdir before deletion, so it's in permanent history)
   # (this works only if all modified files are unique to the branch)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]