SF Git Cheatsheet
SF Git Cheatsheet
Setup & Init push the work on your branch to update that
git push [alias] [branch]
Git configuration, and repository initialization and cloning. branch on the remote git repository
Working with snapshots and the Git staging area. show the commits on branchA that are not
git log branchB..branchA
on branchB
show the status of what is staged for your next commit and what
git status
is modified in your working directory
show the commits that changed file, even
git log --follow [file]
git add [file] add a file as it looks now to your next commit (stage) across renames
reset the staging area for a file so the change is not in your next
git reset [file] show the diff of what is in branchA that is
commit (unstage) git diff branchB...branchA
not in branchB
git diff diff of what is changed but not staged
git diff --staged diff of what is staged but not yet committed show any object in Git in human-readable
git show [SHA]
format
git commit commit your staged content as a new commit snapshot
git rm [file] remove a file from your working directory and unstage tcl/tk program to show the commit log in
gitx
git gui
a GUI
tcl/tk GUI program to make all of these commands simpler
http://developer.salesforce.com
Contributing on GitHub Deploying to Heroku with Git
To contribute to a project hosted on GitHub you can fork the project on github.com, Use the heroku command-line tool to create an application and git remote:
then clone your fork locally, make a change, push back to GitHub, and then send a pull $ heroku create
request, which will email the maintainer.
[Creating glowing-dusk-965... done, stack is bamboo-mri-1.9.2
fork project on github http://glowing-dusk-965.heroku.com/ <http://glowing-dusk-965.
$ git clone https://github.com/my-user/project heroku.com/> | [email protected]:glowing-dusk-965.git <x-msg://536/
$ cd project [email protected]:glowing-dusk-965.git> Git remote heroku added]
$ (edit files)
Use git to deploy the application.
$ git add (files) $ git push heroku master
$ git commit -m 'Explain what I changed'
$ git push origin master Create an additional Heroku app for staging, and name the git remote "staging".
$ heroku create my-staging-app --remote staging
go to github and click ‘pull request’ button
Use git to deploy the application via the staging remote.
$ git push staging master
http://heroku.com