User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
git [2022/04/08 08:23]
dblume Add instructions for rebasing
git [2022/04/25 11:43] (current)
Line 58: Line 58:
 <code> <code>
-git push -u origin master+git push -u origin main
 </code> </code>
Line 77: Line 77:
 git commit -m "first commit" git commit -m "first commit"
 git remote add origin git remote add origin
-git push -u origin master +git push -u origin main
-</code> +
- +
-===== Creating a new remote repository from an existing local one ===== +
- +
-I created wine-tasting at [[]].  Then, to create a new repository on the command line at the local computer: +
- +
-<code> +
-~$ mkdir wine-tasting +
-~$ cd wine-tasting/ +
-wine-tasting$ vim +
-wine-tasting$ vim LICENSE.txt +
-wine-tasting$ git init +
-wine-tasting$ git add +
-wine-tasting$ git add LICENSE.txt +
-wine-tasting$ git add +
-wine-tasting$ git add +
-wine-tasting$ git commit -m "first commit" +
-wine-tasting$ git remote add origin +
-wine-tasting$ git push -u origin master+
 </code> </code>
Line 156: Line 137:
 <code bash> <code bash>
 git checkout -b bugfix/JIRA-1-new-bugfix git checkout -b bugfix/JIRA-1-new-bugfix
-# If main is getting updated, occasionally rebase like so:+ 
 +# If main is getting updated, rebase like so:
 #   git checkout main #   git checkout main
 #   git pull #   git pull
 #   git checkout bugfix/JIRA-1-new-bugfix #   git checkout bugfix/JIRA-1-new-bugfix
 #   git rebase main #   git rebase main
 +# Consider whether you want to squash commits before pushing
 +#   git reset --soft HEAD~3
 git commit -m "fixed bug" git commit -m "fixed bug"
 git push --set-upstream origin bugfix/JIRA-1-new-bugfix git push --set-upstream origin bugfix/JIRA-1-new-bugfix
Line 190: Line 176:
 ... ...
 testcode$ git remote add origin ssh:// testcode$ git remote add origin ssh://
-testcode$ git push origin master+testcode$ git push origin main
 </code> </code>
 I could've used gitweb but I used GitHub-like [[|gitlist]] at I could've used gitweb but I used GitHub-like [[|gitlist]] at
git.txt · Last modified: 2022/04/25 11:43 by dblume