- install git.
- Preferably, SSH key based github authentication due to its ease than
token based over HTTPS url.
i) generate ssh key
ii) add ssh key to github
iii) test ssh key based github auth
Following is simple step-by-step procedure to contribute to repo through git.
- clone the main repo
git clone [email protected]:datakaveri/iudx-deployment.git && cd iudx-deployment
-
Fork the git repository from github UI and get the git clone ssh url of the forked repo ref : https://docs.github.com/en/get-started/quickstart/fork-a-repo
-
Add git remote of your fork,
git remote add my-fork <fork-git-clone-url>
- sync your local git with remote origin (i.e. main repository)
git pull origin master
- create a new feature branch from master of remote repo
git checkout -b <feature-branch-name>
-
Do all your file/folder changes in this branch
-
Review files and see changes of git tracked files
git diff <git-tracked-files>
- Add files to staging
git add <file>
- Before commit, review files to be commited (i.e. those in staging) using
git status
- Commit files (only files in staging will be commited) and add appropriate message in the editor
git commit
The commit message preferrably must contain one line heading covering what commit does. A detailed explanation (if required) in points as shown below:
Adding git docs
- This is a step by step procedure for git contribution
to the repo
- Push the changes to you fork remote
git push my-fork <feature-branch-name>
- After pushing the commits, click on the PR url displayed in terminal. Alternatively, can also create PR from github UI. ref: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork
- To fetch branch from others fork
1.1 Add the thier forkgit remote other-fork <fork-git-clone-url>
1.2 fetch the branchgit fetch other-fork <branch-name>