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!
- After making changes to local repo (project file/folder), Initialize git in the repo using
git init
- 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. Use
git remote -v
to show remote repo and to be certain that you've successfully added the upstream repogit switch -c *branch_name*
to create and switch to a new branch.git status
to view/confirm latest changes made to local repo.git add .
to stage all changes for commitgit commit -m *custom message*
to commit changes with custom message describing what change was made.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