Initial Git Commit

1. Install Git from Git Website
2. Goto your project directory (in my case it is : C:\wamp\www\web)
3. Now Right click on the directory and select “Git Bash Here”

4. Now provide the command on bash “git init” and press enter. One empty git repo will be create


5. Now check the git status using “git status”


6. We have to add the untracked file “index.php” on out repo.
7. To add this file in git we can use the following commands –
a. git add index.php (for single file)
b. git add *.php (for all php files)
c. git add . (for all files)
8. After adding the file in git we can check the git status using “git status” command.


9. To commit the code we have to write
a. git commit (with no comment)
b. git commit –m ‘my comment goes here’ (with comment)
10. If we did not make git setup till now , It will ask for user name and email.


11. We have to setup git config as –
git config –global user.email “myemail@address.com”
git config –global user.name “Tanmay Sarkar”
12. Now again commit the code.
13. Our bash screen will looks like –


14. We have success fully added our initial Project into local Git

Thank you!

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *