git clone https://github.com/mmgyglobal/WWI.git wwi
This creates a local copy of the git repository.
The clone URL can be found on Github.
MMGY's GitHub Organization:
git add path/to/file
Add all files at once
git add .
git rm path/to/file
Remove files recursively:
git rm directory/ -r
git status
Will return what files haven't been added to the repository and local changes that haven't been committed.
Commit command:
git commit -a -m "Commit message goes here"
This command records a "snapshot" of the local tracked changes and keeps the records locally.
This will NOT push changes to the remote repository.
Commit often and commit early.
When working on feature requests (separate branches) - commit as often as possible to make merging as
painless as possible later on down the road.
Also try and provide meaningful commit messages.
git push origin master
This pushes all local commits out to the remote repository. Origin is the repo destination and master is the branch.
git branch about-section
This creates a new branch called "about-section".
Each branch name should be meaningful to the feature enhancement that is being worked on.
git branch
This lists the new branch and the master branch.
git checkout about-section
Run this command to confirm branch switch:
git status
git push origin about-section
This pushes the changes out remotely to the
"about-section" branch.
git checkout master
Confirm that we are in the right branch:
git branch
Now issue the merge command:
git merge about-section
This pulls down the branch into the master branch.
Then push the changes out to the remote repository:
git push origin master
Or use the built-in merging tool with the
previously discussed GUI clients.