Github Policy - sanvi1855544/p3-avatar GitHub Wiki
Commit, pull request procedure
-
Create clone of repo
-
Open terminal and create a branch with the following git command: git checkout -b new_branch
-
Create new remote for the upstream repo with the command: git remote add upstream https://github.com/your username/demo
-
Following code makes a new branch and pushes to new_branch:
-
Push changes to repo and compare and pull request button appears on Github
-
Open pull request by clicking the create pull request button
Branching procedure
- Can use git branch command to make branch
- To create branch and checkout the branch use git checkout -b command
- To create branch from previous commit on existing branch, using git log; git branch commands
- To create branch from another branch use git checkout -b feature4 develop command
- To merge in remote repository use git push --set-upstream origin command
Basic Guidelines
"if you didn't create it, don't commit it"
-Monday is Ideation day and must make ticket for scrum board every Monday
-Must commit and push two days a week to show code progress (Deadline is 5pm Friday)
-Deployment is by Friday 6 pm and must document deployment with ticket
-Commits have to be labeled in this format: Ticket Name- Code Function
-Friday is retrospective/reflection day and must put reflection under ticket
-Must comment code
Notes:
-commit often locally!!
-"git clone" makes a local repository (decentralized) from the cloud server (GitHub).
-A .git directory contains a local database (see illustration) that keeps track of local changes, "git commit" makes a child of the original parent on the local directory. Git commits over time are a series of SHA's.
-A .gitignore file tells .git to ignore certain files in directory tree (ie .idea) -exlcusion thing and tells you what files should be included, can't be version becasue they can cause harm to our colleagues (usually .idea files that are native to intelliJ)
-exclude ".idea", "idl" "idr"
-The "git push" command moves files from local system back to cloud server (GitHub) → we push things to central server
Often a merge is required as a decentralized system has many simultaneous contributors. → merge is a consequence of multiple people working on centralized file (dont want to break anyone's stuff)
Git branches and/or forks can be used to push code to isolated locations to on the server/cloud. This simply delays the inevitable merge, but has benefit of keeping main branch of project stable. Pull requests is common process used to merge code from isolated branches to main branch.
→ Pull request is like having an issue that says I want to merge back to master. But this is not a lot of work. → pull could be from branch or fork → can continue to just work on master branch but can also pull request policy