- Clone the Lyve Cloud Repository: before you contribute to the Lyve Cloud, you'll have to Fork the Lyve Cloud repository to clone it into your private GitHub repository.
- Click to expand: navigate to the repository homepage on GitHub.
- Click Fork
- Create Personal Access Token (PAT): PATs are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line.
-
Config your git:
$ git config --global user.name "Your Name" $ git config --global user.email "Your Email"
-
Clone your project by running the following command:
$ git clone https://github.com/barviv-seagate/Lyve-Cloud-Solutions-Samples.git
-
List the current configured remote repository for your fork:
$ git remote -v
Sample Output:
origin https://github.com/barviv-seagate/Lyve-Cloud-Solutions-Samples.git (fetch) origin https://github.com/barviv-seagate/Lyve-Cloud-Solutions-Samples.git (push)
-
Specify a new remote upstream repository that will be synced with the fork:
$ git remote add upstream https://github.com/Seagate/Lyve-Cloud-Solutions-Samples.git
-
Verify the new upstream repository you've specified for your fork:
$ git remote -v
Sample Output:
origin https://github.com/barviv-seagate/Lyve-Cloud-Solutions-Samples.git (fetch) origin https://github.com/barviv-seagate/Lyve-Cloud-Solutions-Samples.git (push) upstream https://github.com/Seagate/Lyve-Cloud-Solutions-Samples.git (fetch) upstream https://github.com/Seagate/Lyve-Cloud-Solutions-Samples.git (push)
-
Make you origin repository same as an upstream repository:
$ git fetch upstream
-
Create new branch by running the below mentioned command, if you are already not checked out:
$ git checkout -b 'your-branch-name'
Sample Output:
C:> cd Lyve-Cloud-Solutions-Samples C:\Lyve-Cloud-Solutions-Samples>git checkout -b bari Switched to a new branch 'bari'
-
Check git status:
$ git status
Sample Output:
C:\Lyve-Cloud-Solutions-Samples>git status On branch bari Untracked files: (use "git add <file>..." to include in what will be committed) working-with-git.md nothing added to commit but untracked files present (use "git add" to track)
-
Use the command below to add all the files that need to be pushed to the git staging area (dot indicates the addition of all the files. You can add some of the files, instead of the dot write the names of all the files with space between them):
$ git add .
Sample Output:
C:\Lyve-Cloud-Solutions-Samples>git add working-with-git.md C:\Lyve-Cloud-Solutions-Samples>git status On branch bari Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: working-with-git.md
-
To commit your code changes use (m = message, s = signature):
Note: -s (DCO) = Developer Certificate of Origin and Contributor License Agreement, Lyve Cloud always requires DCO.$ git commit -s -m "your-comment"
Sample Output:
C:\Lyve-Cloud-Solutions-Samples>git commit -s -m "Add working with git" [bari 5236f34] Add working with git for developers 1 file changed, 81 insertions(+) create mode 100644 working-with-git.md
-
Push the changes to your branch:
$ git push origin 'your-branch-name'
Sample Output:
C:\Lyve-Cloud-Solutions-Samples>git push origin bari Enumerating objects: 4, done. Counting objects: 100% (4/4), done. Delta compression using up to 8 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 1.31 KiB | 1.31 MiB/s, done. Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (1/1), completed with 1 local object. remote: remote: Create a pull request for 'bari' on GitHub by visiting: remote: https://github.com/Seagate/Lyve-Cloud-Solutions-Samples/pull/new/bari remote: To https://github.com/barviv-seagate/Lyve-Cloud-Solutions-Samples.git * [new branch] bari -> bari Branch 'bari' set up to track remote branch 'bari' from 'origin'.
- Once you Push changes to GitHub, the output will display a URL for creating a Pull Request, as shown in the sample code above.
- Select the relevant repository branch from the Branches/Tags drop-down list.
- Click Create pull request to create the pull request.
- Add reviewers to your pull request to review and provide feedback on your changes.