A list of commands for Git on Github
A list of commands for Git on Github
- 1. Open Terminal
- 2. Change the current working directory to your local repository
- 3. Checking the status of the repository (go inside project folder)
- 4. Staging files (add files to the staging area)
- 5. Making commits
- 6. Pushing changes to repository
- 7. Remove files
- 8. Add / Commit multiple files
- 9. Create a Github blog with fastpages
- 10. Git / Clone a new repository from Github to local
- 11. Ungit a folder
- 11. References
git status
touch test.py
git add test.py
#git add test01.py test02.py test03.py
git add . # adds all files in the directory
git reset HEAD test.py #unstage a file that was commited
git commit -m "Commit message" # commit a file
git log # list of all comits
git checkout <commit-hash> # go back to a previous commited state
git checkout master # go back to last commit
git push origin
git rm test.py
git commit -m "remove test.py"
git rm -r my_folder #delete folder
git add .
git commit -m "m: my mesage flag"
git commit -a -m "m: my mesage flag"
9. Create a Github blog with fastpages
-
Create a new repository from fastpage https://github.com/fastai/fastpages/generate sims-coursera
-
Follow the indication in Initial Setup file to generate and create secret and public keys
-
Accept / Merge the pullrequest: https://github.com/simsisim/sims-coursera/pull/1 (3-4 min)
-
Blog generated: https://github.com/simsisim/sims-coursera
-
Customize blog title etc. by changing: https://github.com/simsisim/sims-coursera/blob/master/_config.yml
10. Git / Clone a new repository from Github to local
-
mkdir new-folder
-
cd new-folder
-
git init
-
git clone https://github.com/new-folder.git