===================
pwd // Let’s see where we are
ls // List all the folders/files of our location
mkdir GitTutorial // Create a folder(pick a place you feel comfortable with)
cd GitTutorial // Go into that folder
touch README.md // Create a read me file
vim README.md // Edit read me file. Press i to insert, esc+:+wq (wq = write quit)(Will also create the file if it didn't exist)
cat README.md //Preview the file
rm README.md // Remove our masterpiece
git clone https://github.com/YourUsername/TestPullRequest.git. //forked version
Use a code editor to edit or you can use vim(use vim if you don’t have a code editor).
vim nameoffile
It will opent vim in the terminal and you’ll see the file. You need to press ‘i’ on your keyboard to be able to edit it. To save your work you have to press esc then ‘:’ and then type wq (which mean write quit). If you didn’t want to write to the file and you just wanted to read you can just do :q
git add .
git commit -m “First Commit by yourname”
git push // this won’t work right away if you didn’t do the config
git config --global --edit
git commit --amend --reset-author
Now you can git push! Go check on your github your changes!
Tip: A big benefit to create branch is to unit test your code in the branch before you merge it with master
git checkout -b MyFirstBranch_YourName
Hint: it says 5 errors, but technically you can only fix 4 in the code . The fifth one you have to add something to your folder . (it's totally okay if you don't find all of them)
git status
git add .
git commit -m “ Fixed blabla”
git push --set-upstream origin nameofyourbranch //you only need to do this one time then the second time you push you just need git push
git log
It’ll say pull request click on that
I wrote an issue you can directly go and discuss it with me if you want.
Next steps:
- Read about git rebase
- Read about git squash
- Read about fixup
- Read about git cherry picking
* git add . → add all changed files in the staged area
* git commit - m “ Put something that reflects what you changed/created” →
* git push → push your changes to the remote repository
* git pull → Download the latest changes and integrate them into your project
* git status → Check which files have been stages or committed
* git branch → Check which branch you’re on
* git checkout nameofbranch → Move to nameofbranch
* git checkout -b nameofnewbranch → Create a new branch and check it out
* git clone link → Clone a repo
* git init → make a directory a git repository
* git log → print a log of your commits
* cd → Current directory
* pwd → Print working directory
* touch → Create a file
* mkdir → Create a directory
* vi name of file → Open and edit a file
* cat → Display content of a file
* ls → List everything in your current directory
* echo $nameofwhatever→ Will print the path to whatever you want
* history → Will print the history of all of your shell commands
* man nameofterminalcommand → Will explain that command
* mv nameoffile location → Move file/directory somewhere else
* tar -xvf yourfile.tar → Extract tar file
* whoami → Find out who you are logged in as
* rm nameofile → Remove name of file
* ls -a → See hidden file(bashrc for example)
* tree → See the hierarchy of your files
* find . -name "pattern" -print → Find specific files
Download Git
Markdown Online Editor
Markdown Tutorial
Markdown Interactive Tutorial
In Browser IDE
Oh my zsh
Homebrew
Cmder
Update forked repo
Great upstream explanation
Powerpoint Link
Good first issues
Github Education pack
Open Source for beginners
Do you have any good resource that could complement this? Do a pull request!