🌠VERSION CONTROL ðŸŒ
- Version Control is a lifesaver or rather software development lifecycle saver, without it software development would be dirty mess. My favorite analogy is an 100-piece orchestra without a conductor; chaotic, huh! 🤔
- So version control systems are basically systems that track and manage changes made to source code.
-
The most widely used VCS is Github, which I use. Github is a distributed VCS that:
- Users access the repository from any location hence distributed
- Contributors can work on the same codebase without being on the same network
- Each developer has a local copy of the entire repository and history on their device
- Users can commit, branch, and merge changes locally without reliance on the central server
🤖WHAT TO KNOW ABOUT GITHUB🤖
Forking
- Forking comes in handy when you are trying to fix an issue or propose some changes in the upstream repository, that is the repository in which changes are pushed to.
- A fork then is basically a copy of another user's repository in your own account
-
To fork:
- Head on to the github repository you would like to fork
- On the top left corner click the button, fork
- Click create a fork
- Now you have your own copy of that repository
Collaboration
- Collaboration is when users can invite collaborators(anyone with read and write access to a repository who has been invited to contribute by the repository owner) to a repository, manage their access permissions, and track changes through commits and pull requests.
- Allowing teams to work together on projects, review each other's code, and integrate changes efficiently.
Pull requests
- Pull requests are proposed changes to a repository to be merged, that are submitted by a user.
- The proposed changes can be accepted or rejected by a repository's collaborators.
- The collaborators can also choose who to give permissions to pull requests.
Merge Conflicts
- First off what is a conflict, it's when different changes have been done by different collaborators on the same file, thus a conflict.
- When this happens, the developer has to merge, that is to choose which changes to keep or discard for a harmonious merge.
Code Review
-
Code reviewing is the examining of code changes proposed in a pull request to identify potential issues, suggest improvements, and ensure that the code is not going to negatively interfered with.
- The work reviewers do
- Reviewers analyze the code changes, looking for potential bugs, issues, or areas for improvement.
- They can leave comments directly on the code, highlighting specific lines or sections that need attention.
- Comments can be general feedback, specific suggestions, or requests for clarification.
- Reviewers can also initiate a formal review, which allows them to bundle multiple comments and submit them together.
Github Issues
- Issues are used to track ideas, feedback, tasks, or bugs.
Also there are a number of ways to create an issue like via Github CLI or via projects, via discussions, from repo, from code, from comments and from URL query
GitHub CLI is an open source tool for using GitHub from your computer's command line. When you're working from the command line, you can use the GitHub CLI to save time and avoid switching context.
To create an issue, use the gh issue create subcommand. To skip the interactive prompts, include the --body and the --title flags.
gh issue create --title "My new issue" --body "Here are more details."
You can also specify assignees, labels, milestones, and projects.
gh issue create --title "My new issue" --body "Here are more details." --assignee @me,monalisa --label "bug,help wanted" --project onboarding --milestone "learning codebase"
Github commands
- There are many commands used but the most common ones are these
git clone
git push
git pull
git commit -m "message"
git add
Pushing changes to github
To push the changes you made on your local branch to the remote repository just use the git push command like so:
Keep in mind the git push command takes two arguments: A remote name, for example, origin and a branch name, for example main
git push REMOTE-NAME BRANCH-NAME
Top comments (0)