Editing
Git Workflow
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Working with existing projects== * Make sure the 'dev' drive is available on the current client. See [[#Configuration|Configuration]] Using 'Git Bash' navigate to the project directory. <syntaxhighlight lang="bash"> $ cd /m/littledamien/littledamien_web </syntaxhighlight> * To see a list of previous commits (which should include the branch names as part of the commit message): <syntaxhighlight lang="bash"> $ git log --oneline </syntaxhighlight> * Make a new Git branch : Naming convention: 'tm' + sequential number <syntaxhighlight lang="bash"> $ git co -b mynewbranch </syntaxhighlight> * Edit as necessary. Then verify changed files with <syntaxhighlight lang="bash"> $ git status -s </syntaxhighlight> * Add edits to commit with <syntaxhighlight lang="bash"> $ git add filename.ext </syntaxhighlight> * Stage a deleted file with <syntaxhighlight lang="bash"> $ git add -u filename.ext </syntaxhighlight> * Revert files with <syntaxhighlight lang="bash"> $ git co HEAD filename.ext </syntaxhighlight> * Verify edits with <syntaxhighlight lang="bash"> $ git diff --cached $ git diff --cached filename.ext </syntaxhighlight> * Commit the edits ('tm0001' being the branch name used to track projects) <syntaxhighlight lang="bash"> # commit all edits $ git commit -m "tm0001: commit message" # switch to master branch $ git co master # merge edits into master branch $ git merge tm0001 # clean up branch $ git branch -d tm0001 </syntaxhighlight> * Then move the commits to the main repo: <syntaxhighlight lang="bash"> $ cd /n/git/littledamien/littledamien_web $ git pull /m/littledamien/littledamien_web $ # or $ git push ssh://[uname]@[domain].com:[port]/refs/littledamien/littledamien_web $ # or $ git push ssh://[uname]@[domain].com:[port]/refs/littledamien/littledamien_web master $ # or (after creating an alias in .ssh/config) $ git push dbarchowsky:/refs/littledamien/littledamien_web </syntaxhighlight>
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information