- GIT
- github account
- Command Line
- Tools like gitKraken(Paid/Free for students)
- Github Desktop(free)
- Set Username
git config --<system_flag> user.name "<name>"
- Set email
git config --<system_flag> user.email "<user_email>"
System flag can be set as:
- local : Repository-specific settings
- global : User-specific settings. This is where options set with the --global flag are restored.
- System : System-wide settings
Create a shortcut for a Git command. This is a powerful utility to create custom shortcuts for commonly used git commands. A simplistic example would be
git config --global alias.ci commit
Now instead of "git commit", I can do "git ci" to start commit my changes.
git clone <link_to_github_repo>
Example : We want to copy this demo repo
- click on the Code.
- Make sure you have selected the HTML option[1]
- copy the link in the textbox
- Run the following command in the terminal.
git clone https://github.com/sakshambedi/final_project_3380.git
You have successfully copied the repo to your local machine.
- Open the working directory in the terminal
- Initiate a repo
git init
- Make a git ignore file. A git ignore is a simple file used to disregard files that are not useful to share. You can download a git ignore template from github's gitignore link, depending upon the type of project the user is working on. More info on git ignore.
- Make a README.md file (optional)
- Use "add" to add all the files you want to start keeping track of. -A flag = ALL which means it will add all the files except the ones mentioned in the .gitignore
git add -A
- Commit your changes with the commit command. Use the -m = Message to add a message for the commit for reference.
git commit -m "<your message here>"
- Now go to github and login into your account.
- Click on "NEW" button on the top left. Give it a name, description (optional) and access (Private/Public). You do not need to a README.md file and a gitignore file. Choose a license if necessary and click "Create Repository"
- Now you can push the local code to the existing repository on github. To do so follow the instructions in the "push an existing repository from the command line : "
Branching in github can be really useful to work in team without disturbing the production code. GUIDE TO BRANCHING
git checkout <branch_name>
NOTE : Using the -b flag will create a new branch.
git checkout -b <name_of_new_branch>
This how you create a new branch. Once you have created a new branch you can do anything here and it will be stored locally. Once you are donw working on your implementation, you can push that new update to the cloud repository.
You can easily delete a branch using the -d flag
git branch -d <branch_name>
Please follow the recommendation for git while working on the project. A Git Project can have a main/master branch. This is the primary branch which can be used to publish a feature/update.
Recommendation by Jeremy.
- Main Branch : This is the primary branch and updates to this branch can only be pushed by people with Maintain and Admin roles. This branch can be set to CI/CD when a new update is pushed.
- DEV Branch : This is the branch where all of the active developement takes place. This can also be referred as a BETA branch. Once the code is reviewed and all the testing has passed, the code from this branch can be merged to main branch for release.
More branches can be created out of the dev branch to implement an individual feature and the baby branch can be merged back in the "DEV" branch.
Recommened Reading: Branching in a nutshell!
Repository Roles for Organization
- Read : Recommended for non-code contributors who want to view or discuss your project
- Triage: Recommended for contributors who need to proactively manage issues and pull requests without write access
- Write: Recommended for contributors who actively push to your project
- Maintain: Recommended for project managers who need to manage the repository without access to sensitive or destructive actions
- Admin: Recommended for people who need full access to the project, including sensitive and destructive actions like managing security or deleting a repository
Organization owners can set base permissions that apply to all members of an organization when accessing any of the organization's repositories. For more information, see "Setting base permissions for an organization."
Permission are available in Github to restrict and control the access of a repository.
SOURCE : LINK HERE
Github can also we used to authorize sign up and signing in for application.
Resource : Authorizing using Github
Issues in github is used to quickly create issues, track work and stay up to date with the bugs and issues in the project. It increases community envolvment and a medium of effective communication.
-
On the main page, go to the issues tab.
-
Click on new issue
-
Give it a title and a description. Choose a assignee, give it one label out of the followings :
- bug
- documentation
- duplicate
- invalid
- question
- wontfix
-
Choose the project if it is part of a project. Finally choose milestone.
Congratulations you have created your first issue!! NOTE : For an organization, the user must have admin or owner role to delete an issue.
This tab contains all of the pull request made by the teams. The changes can be reviewed on this page before making a final decision.
Actions is an CI/CD platforms to assist automating building, testing and deploying pipeline. Users can run a workflow to automatically add the appropriate labels whenever someone creates a new issue in your repository. Documentation for Github Actions
This part of github is still in beta.
Wiki is a section for hosting documentation. You can use your repository's wiki to share long-form content about your project, such as how to use it, how you designed it, or its core principles. A README file quickly tells what your project can do, while you can use a wiki to provide additional documentation
A README is often the first item a visitor will see when visiting your repository. README files typically include information on:
- What the project does
- Why the project is useful
- How users can get started with the project
- Where users can get help with your project
- Who maintains and contributes to the project
Setting contains all the settings for the repository, including ablity to change the name of the repo and ability to delete it.