1. Create a GitHub account
2. Download and Install Git in your system:
3. Verify if Git is installed by using the following command in the command prompt:
# git --version
4. Open command prompt at your project directory and enter the following command to initialize the Git:
# git init
5. Use the following command for staging the file:
# git add demo.txt
# git add file1 file2 file3 (In case you want to add multiple files you can use)
# git add . (To add all the files inside your project folder)
6. Use the following command to commit the file:
# git commit -m "commit_message"
7. In order to point your local repository to the remote repository, use the following command:
# git remote add origin repository_url8. In order to push all the code from the local repository into the remote repository, use the following command:
# git push -u origin master
9. Finally use your username and password/personal access token of your Git account to complete the upload...
10. If you are a windows user, enter the following commands before doing 6th step...
# git config --global user.name "your_user_name"
# git config --global user.email "your_email@gmail.com"
_______________________________________
10. Someother important Git commands:
# git pull (to pull the latest changes from the remote repository) # git log (to print out all the commits)
# git status (to find out information about the files & changes) # git branch (to list out all the branches in local)
# git checkout -b "branch_name" (switch to the new branch)
# git checkout branch_name (switch to the existing branch)
# git merge merge_from_branch_name (merge files between two branches)
# git clone repository_url (to clone an existing remote repository into your computer)