-
Notifications
You must be signed in to change notification settings - Fork 48
Pushing changes to ViewTouch
A simple git tutorial for getting started:
http://rogerdudler.github.io/git-guide/
A more detailed understanding of git:
https://git-scm.com/book/en/v2
Jack's favorite:
https://nuclearsquid.com/writings/git-tricks-tips-workflows/
The following assumes one already has a local cloned repository and has made a source file modification.
.gitignore tells git to ignore the /build and /dat directories when pushing changes to GitHub. More about gitignore at https://help.github.com/articles/ignoring-files/
git status -- lists changed source files and offers clues about what to do next
git diff -- shows code changes (optional)
git add (name) ... -- stage changed source files for committing
To undo staged (added) files:
'git reset HEAD ...' to unstage
or ``
git stash
`git stash pop`
git commit
-- commit staged files
this opens the text editor to allow entry of a ‘message’ explaining the new code.
git commit -m 'your message'
is an alternative to using a text editor.
Now you've updated your local copy (the "master" branch if you haven't forked new branches).
git push
username:
password:
git push origin master
-- updates your branch on the github server ("origin")
git push main master
-- updates the main branch on the github server ("main")
git stash
is a pull that preserves any changes one has made but not yet pushed
Review the differences between origin and master
git log HEAD..origin/master