Team Collaboration using Git and Github

As a novice using github for team collaboration, it can be a daunting task looking for the right git commands to help you get started and effectively contribute to the team repo. This blog post is an ordered documentation of commonly used git commands. The frustration that arises from having to search the web over and over again for these commands inspired this post. Although I'm not very experienced using git, but this list will be updated whenever I get to use a new git command. So guys, let's learn on the job!

  1. After making changes to local repo (project file/folder), Initialize git in the repo using git init
  2. Add upstream repo; copy the repo url from github, then use git remote add origin *remote_url* this links your local repo to the remote repo.
  3. Use git remote -v to show remote repo and to be certain that you've successfully added the upstream repo

  4. git switch -c *branch_name* to create and switch to a new branch.

  5. git status to view/confirm latest changes made to local repo.
  6. git add . to stage all changes for commit
  7. git commit -m *custom message* to commit changes with custom message describing what change was made.
  8. git push origin *branch_name* to push changes to "branch_name" of remote repo origin

Also, feel free to add other commands in the comment section