Accessing and updating a git repository
First thing to do is to create a local git repository.
- In the directory which you want to make a repository, $git init M
- At any point you can type $git status to know what are the files that are being monitored
- Add any file to the tracked repository by typiing $ git add ***.**. At this stage the files are staged
- Lastly you can commit changes to the repositry by the command $git commit -m "comment for the commit"
- In GIT you may want to branch. To create a branch you type $git branch branch-name
- to change the working branch to the new one type $git checkout branch-name
- After making all the changes, you are satisfied and now want to commit the changes to the main branch. That is you want to merge the newly changed branch to the main branch. For this:
- First $git checkout main
- $git merge branch-name
- If no longer necessary delete the other one git branch -d branch-name
- There can be more complicated scenarios when there are conflicts between the branches that are merged. That needs to be addressed case by case
Now to upload the repository to github