Your First Git Repository
In this tutorial we will be creating new repository and run basic commands
Create new repository and call it "dotsway"
Create a folder and initializing it.
Now if you run ls -la you will notice a hidden folder called "git" this folder which will contain all tracking info.
Create new code file.
Check GIT Status
Now you will notice that a file is added but not under the version control system.
Add the file to repository
git add code.py
Now the file is adding to staging area but not committed to repository.
Your First Commit.
First you need to create README.MD file, MD stands for markdown which is a way of formatting the file. Add whatever information to that file and then save and exit.
Second you need to create a hidden file called gitignore and in this file you will list folders and/or files which you don't want to be under version control (ex.: swap files, temp files or data).
*.swp "for example"
Save and exit.
Commit Changes to Repository
git commit -m "My first commit comment note"
Using Git Diff
If you use below command you will check the difference between the files and staging "the files added with git add"
If you use git diff and HEAD you will get the difference between files and repo server.
git diff head
View log for certain file
git log file-name.py