Here are some useful cheatsheets for Git & GitHub commands:
- Cheatsheet for Mac & Linux Users
- Cheatsheet for Windows Users
- List of Git Commands
- In your terminal, run the command
git version
. If Git is not installed, you can install it here - For some parts of the challenge, we will be using a text editor. Download Sublime Text if you don't have one already
- Set your username & email on git. To set your username, run:
git config --global user.name "your_name"
. Switch your_name for whatever your name is. - To set your email, run:
git config --global user.email "your_email"
. Switch your_email to whatever your email is. - Make sure to sign up for GitHub.
Remember to use your cheatsheet, get help from your buddy, & ask for help.
- Open your terminal
- Print out your directory
- Create a new folder using your command line
- Move into your new folder and create a new file named
index.html
- Initialise git for the directory
- On your desktop, drag your new
index.html
file into your text editor. Write something inside & save it - In your terminal, use the Git command to review the status of your files
- Add your
index.html
to the staging area - Add a commit message to explain what changed in your file
- Create a new branch & go into it
- Add a new line of text in your
index.html
file - Again, add your changes and create a commit message about the changes
- Now, use
git checkout
to get back to your master branch - Merge the changes from your branch into your master branch
- Open your terminal
- Print out your current directory. Make sure you are in your Desktop or in the previous folder you were working with
- Go to this repo:
https://github.com/sheesh19/workshops-github-101
- Fork the repository (to make you the Master of the repo)
git clone
your new repo into your folder
- Create a new branch & switch to the new branch
- Update the HTML file with your name & save it
- To save the version, use
git add <file_name>
- Add a commit message with
git commit -m "your commit message"
- Run
git remote -v
to see the remote repo linked to your project - Finally, push your branch to GitHub! Make sure to use
git push origin <your_branch_name>
- Create a pull request & merge your branch on GitHub
Congratulations! You've made your own local files, used a GitHub repo, and created a pull request to update the master.
-
For more Windows Terminal Commands
-
For more Mac & Linux Terminal Commands
-
To learn more about Le Wagon
-
Connect with me at LinkedIn
-
Learn more about me