#2. How to use/setup Git in any project using Git Bash or Command Prompt.
Read time : 5-6 minutes
Step 1 : Git Installation.
First please download and install git from the following URL :
Verify the installation : If Git has been successfully installed , then you will find the following option when you right click on you desktop.
Step 2 : Registration and Project Creation on GitHub.
1. Go to https://github.com/ and register with your email address (don't worry, its free for personal use).
2. Sign in with your registered email address.
3. Go to repositories tab and click on new to create a new repository (later we will use this repository to commit/push our code).
4. Enter Repository name (can be any thing) and click on create repository and your repository will be created.
Step 3 : Create a project into your local system .
Create any project (Project can be in angular, java, python , simple html or any language).Note : I have created a simple HTML (file name : dorado.html) and a CSS file(dorado.css)
See my project directory :
Step 4 : Push your local system code to GitHub .
1. Go to project directory.2. Right click and click on Git bash here , it will open a terminal.
3. Run the following command on terminal.
- git init
- git remote add origin https://github.com/gitusername/gitrepositoryname
- Note : (for me URL is : https://github.com/dorado2041/DoradoDemo.git)
- git add * (* will commit all file , If you don't want to commit all the files then specify file name in place of *)
- git commit -m "first commit" (To commit the code)
- git push -u origin master (To push the code into GitHub Repository)
- Note : It will ask for you username and password for the first time .
Conclusion :
This is all about , how to setup use/setup Git in any project using Git Bash or Command Prompt.In next post, we will see how to setup use/setup Git in any project using Git Gui , in case you don't like using command prompt.
For more updates please follow us on :
Facebook : https://www.facebook.com/dorado2041
Instagram : https://www.instagram.com/dorado2041
Blogger : https://doradosolutions.blogspot.com
No comments: