Working with Repository
Step 1: Create repo in github.
- Click on “+” top right corner and get nice menu options
- Click on New repository
- Enter repo name and click create repository button.
Step 2: Navigate to your new repo.
Step 3: Click on Clone or download button and copy the URL of repo.
Step 4: Open git bash
Step 5: navigate where you want to put your all code in your folder structure by using “cd” command.
Step 6: Use command git clone to get the repo in your local machine.
git clone <you copied repo URL>
Step 7: now navigate to repo and work locally add/ update files as you want.
Step 8: use command to check the status, it will show all new/updated/deleted filed or we can say it shows all changes in the repo
Step 9:add all the modified/new files for commit
git add .
it will add all changes .
if you want to add specific file then append command with file name.
git add test.txt
Step 10:Now our all changes are added ,now we need to commit and then push these to the remote repo.
git commit -m “comment for this commit”
git push origin <branch name>
Now you can verify your changes on your git hub repo .
As we are working directly on master branch the file is available on master branch. Ideally we create new branch for a functionality do our all work in that branch and push it to git hub, then reviewer review it and merge it. we will look for this in next post.