-
Notifications
You must be signed in to change notification settings - Fork 38
GitHub Quick Start
-
GitHub sspl's repo link
-
GitHub authentication method (Use anyone for the authentication)
- Using HTTPS connection
Generate access token in the GitHub UI.
- Using SSH key
Generate ssh key and add public key in the GitHub UI.
- ssh-keygen -t rsa
- https://github.com/settings/keys
- Enable SSO
- Using HTTPS connection
-
Create a personal repo from the cortx-sspl repo
Use GitHub UI to fork repo from cortx-sspl repo.
-
Clone forked Repo in the local machine
git clone git@github.com:"GitHub UserId"/cortx-sspl.git Remember to update your username and email in git config.
git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "MY_NAME@example.com"
If you are using different repositories with different email ids, then --global is not a good idea. Go to SSPL directory and then run the above commands in that directory without --global option.
-
Create a feature branch in the local repo from the master. Make sure your master branch is up to date with the upstream master. Follow the sync up steps to update local master when your local master is behind with upstream master
git checkout -b "feature branch"
-
Do the code changes
-
Stage your local changes
git add "File path which are modified"
-
Commit your staged changes
git commit -m "commit message"
-
Push feature branch to the origin(forked repo)
git push origin "feature branch" (After this command your local feature branch will be visible in the forked repo)
-
Create a pull request from the feature branch of the forked repo(origin repo) against the master branch of Seagate/sspl(upstream repo) using GitHub UI. Make sure that all the local changes are available in the origin "feature branch". You can verify your changes from the GitHub UI itself from the origin branch commit history.
-
Submit changes once it's approved (Two approvals are required, it's configurable we can change it based upon our need)
-
Jenkins job will get triggered automatically after every check-in in the master of Seagate/sspl.
http://eos-jenkins.colo.seagate.com/job/Release_Engineering/job/github-work/job/SSPL/
Setup upstream repo in the remote list ( It's one-time activity )
-
git remote -v (See the current configured remote repository for your fork.)
- origin git@github.com:VijayThakkar132/cortx-monitor.git (fetch)
- origin git@github.com:VijayThakkar132/cortx-monitor.git (push)
-
git remote add upstream git@github.com:Seagate/cortx-monitor.git
-
git remote -v (Upstream repo should be visible)
- origin git@github.com:VijayThakkar132/cortx-monitor.git (fetch)
- origin git@github.com:VijayThakkar132/cortx-monitor.git (push)
- upstream git@github.com:Seagate/cortx-monitor.git (fetch)
- upstream git@github.com:Seagate/cortx-monitor.git (push)
Sync origin master with upstream master
- git fetch upstream (Fetch the branches and their respective commits from the upstream repository)
- git checkout master
- git rebase upstream/master or git merge upstream/master (rebase is preferred)
- git push origin master
Sync origin feature branch with upstream master
-
git fetch upstream (Fetch the branches and their respective commits from the upstream repository)
-
git checkout "feature branch" (In case you are not in your feature branch)
-
git rebase upstream/master or git merge upstream/master (rebase is preferred)
-
git push origin "feature branch"
-
Note: Sometimes, It fails to push local branch changes to origin after rebase. Use --force option to push it forcefully. Follow below link for the more detail:
https://stackoverflow.com/questions/8939977/git-push-rejected-after-feature-branch-rebase
Forcefully reset your branch with upstream master
- git pull --rebase upstream master
- git reset --hard upstream/master
- git push origin master --force
Developer workflow link shared by DevOps Team
- https://seagatetechnology.sharepoint.com/:w:/s/CORTX/Ecs1yM131yZJuOzyDt5-mqoByNt4HhWHNCRqfPGL08pWcw?e=4%3A2M2HWD&at=9&CID=1f846324-ff98-35ff-fe6c-d68a266411ea
- https://seagatetechnology.sharepoint.com/:w:/s/CORTX/Efh7z0NF4r9JpVUZD96O8rwBXz9okc6J5OXS7Q8FZjB3mg?e=4%3AQotq5y&at=9&CID=5156f995-a028-6a29-1d9b-c91728b07d8b