-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from DCAN-Labs/more_edits
Added more GitHub tips and made formatting edits
- Loading branch information
Showing
16 changed files
with
48 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Common Git Commands | ||
|
||
This page contains common commands used to work with Github repositories via git. This is by no means an exhaustive list of commands. | ||
This page contains common commands used to work with GitHub repositories via git. This is by no means an exhaustive list of commands. | ||
|
||
## Basics | ||
|
||
`git clone https://url-to-repo OR [email protected]:repo/location.git` | ||
|
||
- Clone a github repo. Two methods: HTTPS or SSH. SSH is recommended as it will not require a token every time you interact with the repo (push/pull/etc) on MSI. Learn how to set up SSH with Github [on this page](github-quick-guide.md). If you do use HTTPS on MSI you will need to [create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) and enter it every time you interact with the repo. | ||
- Clone a GitHub repo. Two methods: HTTPS or SSH. SSH is recommended as it will not require a token every time you interact with the repo (push/pull/etc) on MSI. Learn how to set up SSH with GitHub [on this page](github-quick-guide.md). If you do use HTTPS on MSI you will need to [create a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) and enter it every time you interact with the repo. | ||
- If you would like to only clone a specific branch, add `-b branch_name --single-branch` after `clone`. | ||
|
||
`git status` | ||
|
@@ -15,7 +15,7 @@ This page contains common commands used to work with Github repositories via git | |
|
||
`git checkout -b branch_name` | ||
|
||
- Move to a new/different github branch. If the branch already exists, do not include the `-b`. | ||
- Move to a new/different GitHub branch. If the branch already exists, do not include the `-b`. | ||
|
||
- `git branch new_branch_name` also creates a new branch but doesn't also move you to the new branch | ||
|
||
|
@@ -33,13 +33,13 @@ This page contains common commands used to work with Github repositories via git | |
|
||
`git push` | ||
|
||
- Push your commit to the github repo | ||
- Push your commit to the GitHub repo | ||
|
||
- If you made a new branch locally, to add it to the origin, run `git push --set-upstream origin branch-name` | ||
|
||
`git pull` | ||
|
||
- Pull the contents of the github repo to your local computer | ||
- Pull the contents of the GitHub repo to your local computer | ||
|
||
## Advanced | ||
|
||
|
@@ -52,7 +52,7 @@ git checkout branch_to_update | |
git rebase main | ||
``` | ||
|
||
If a branch name changed on Github but it still has the old name locally and you can no longer push to/pull from the old branch name: | ||
If a branch name changed on GitHub but it still has the old name locally and you can no longer push to/pull from the old branch name: | ||
|
||
``` | ||
git branch -m old_name new_name | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.