-
Notifications
You must be signed in to change notification settings - Fork 11
Working with Git and GitHub
Joe Cartonia edited this page Aug 6, 2020
·
1 revision
If you are new to using Git for version control, then please visit the following sites to learn about it:
- A step-by-step guide to Git
- Getting Started - About Version Control
- CodeAcademy - Getting Started with Git and GitHub
- GitHub Guides
# Clone from a public repository using an HTTPS URL address
[ferris@bueller weforms-pro](master)$ git clone https://github.com/BoldGrid/weforms.git -b master
# Clone from a private repository using an SSH Git path
[ferris@bueller weforms-pro](master)$ git clone [email protected]:BoldGrid/weforms-pro.git -b master
There are times when you want to configure a public repository with the pull address using HTTPS and the push address using Git/SSH. When using this configuration, you can perform pulls without having to authenticate.
[ferris@bueller weforms-pro](master)$ git remote set-url --push [email protected]:BoldGrid/weforms.git
# Check the current working tree status.
[ferris@bueller myrepo](master)$ git status
# If not working in a clear tree, then stash, commit, or discard the changes.
[ferris@bueller myrepo](master)$ git checkout .
# Pull in any changes from the remote master branch.
[ferris@bueller myrepo](master)$ git pull origin master
# Create a new branch based on the master branch.
[ferris@bueller myrepo](master)$ git checkout -b my-branch
# Commit your changes. You can reference GitHub issues by number using "Fixes #".
[ferris@bueller myrepo](my-branch)$ git commit -am 'Fixed bug. Fixes #1'
# Push the commit(s) to the remote repository.
[ferris@bueller myrepo](my-branch)$ git push origin my-branch
# Create the tag.
[ferris@bueller myrepo](my-branch)$ git tag -a 1.2.3 -m 'Patch release'
# Push tags to the remote repository.
[ferris@bueller myrepo](my-branch)$ git push --tags