So I’ve been using Google Drive to store my scripts in a “public repo” that I push my sanitized scripts to every so often, but I’ve always wanted to do it the “right way” by sending to Github. Here are the steps I did to do that.
Download and install Git for Windows and Github Desktop.
Create a repo – This is just a folder I created on Google Drive that is synced that I just call “Github”. It can be any folder with any path.
2b. Copy scripts there.
- Then run inside Git Terminal:
cd path\to\githubrepo\reponame git config --global user.name "gerryw1389"
git config --global user.name
# In Github desktop, go to File – Options – Git. Copy the email address
git config --global user.email "yourGithubEmailAddress@users.noreply.github.com"
- Now initilize the repo
- Add you files
git add --all
- Commit your files locally to your computer
git commit -m 'first commit'
- Then pull the latest from Github, should be blank
git pull origin master
- Finally push your local changes (commits) up to Github
git push origin master # or just 'git push'
Using Github Desktop:
- When I’m ready to “sync to Github”, I just open my Github desktop application and skip the “fetch origin” tab (4) and just do steps 1-3
Update: Ignore step 4 in the image, you actually do want to ‘fetch origin’. All it does is pull down the latest scripts from github so you can test against your latest commits and make sure they still work before doing a ‘push’.
- Then, after selecting “commit to master”, it automatically changes to “push origin”. That is what I push to push my changes to Github.
- Then they show in Github. Notice that what you write in Step 1 (from pic in step 2) is what shows up online. Also note, I use the dark theme with Stylish as described in this post.