👍🎉 First off, thanks for taking the time to contribute! 🎉👍
Getting started with Git and VMware-Samples
How to contribute to EUC-Samples
- Create your own git account & sign in
- Get your own copy of the VMware-Samples repo (https://help.github.com/articles/fork-a-repo/)
- Go to https://github.com/vmware-samples/euc-samples
- Fork the repo to your account
- Go to the fork in your Git repository
- Click the Clone button to copy the repo URL
- If you don't already have Git on your machine:
-
Download and install git on your local machine
-
Create a project folder
-
Open git Bash in that folder
-
Run:
git clone https://github.com/<username>/EUC-samples.git
-
- Now you should have the 'EUC-samples' folder in your projects folder. This is the local version of your repository. We'll refer to it as Local. Your fork is a copy of the original repo. We'll refer to it as Remote. The original repository is EUC-Samples in VMware-Samples. We'll refer to this as Main.
- You will default to the Master branch of your repo.
- Verify your Local repo has the remote repo configured.
-
Run:
git remote –v
-
This will list 2 records pointing to your remote, both nicknamed Origin. Now you can reference the Remote without listing the whole URL, but simply by saying 'origin' in your commands.
-
- Now we need to configure Git to sync your fork with Main so you can always get the most current version.
-
Run
git remote add upstream https://github.com/vmware-samples/EUC-samples.git git remote –v
-
This will now list 4 records, 2 pointing to your Remote, and 2 pointing to Main, nicknamed 'Upstream'. Now you can reference the Remote without listing the whole URL, but simply by saying 'origin' in your commands.
-
- Now you're all set to begin making your changes
-
If you already have forked from Main and created a Local copy, fetch from upstream to merge latest changes to your local master branch. You can do this by running:
git checkout master git fetch upstream
-
Create a local feature branch to begin working on your changes. This branch will only be created locally.
git branch feature-name
-
Make your changes (like copying files over, editing files, etc.)
-
Once you're happy with a set of changes, make your commit (be sure to sign your commit)
git add . git commit -s -m 'your commit message here'
-
Continue making changes and committing locally (sign every commit)
-
Once you're ready to push these commits to Remote, run the following command to create the feature branch on your Remote
git push origin feature-name
-
Navigate to your Remote and create a Pull Request (PR) to merge your commits to the Main repo
-
Someone will review and approve your PR
- Clean up your Local and Remote repos
- Delete your local feature branch (git checkout master; git branch -D feature-name)
- Delete your remote feature branch (do this from the UI)
- Update your local master branch from the main repo master branch (git checkout master; git fetch upstream)
- Push your local master to your remote master (git push origin master)