Add git init to getting started

This commit is contained in:
James Skemp 2021-09-06 16:19:02 -05:00
parent e1bc681026
commit 9dd24919a5
1 changed files with 9 additions and 1 deletions

View File

@ -4,6 +4,11 @@
git clone _.git
git clone _.git differentFolderName
# Create a new repository in the current directory.
git init
```
```bash
# Add a new remote for a repo. In this case 'upstream' might be helpful for the repo this was forked from.
git remote add upstream _.git
@ -13,9 +18,12 @@ git branch <branchName>
# Switch current repo to a different, existing, branch.
git checkout <branchName>
git checkout master
```
## Clone troubleshooting
```bash
# If running into issues cloning a repository, clones a shallow copy. Then updates remotes and fetches everything.
git clone --depth=1 _.git
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch --unshallow
```
```