Skip to content

seaniesean/nus-git-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reference

Maven Command

  1. mvnw

  2. mvnw compile

  3. mvnw clean package

  4. mvnw spring-boot:run

  5. mvnw clean package spring-boot:run

  6. mvnw spring-boot:run -Dspring-boot.run.arguments="--port=3000"

  7. mvnw spring-boot:run -Dspring-boot.run.arguments="--port=3000 --dataDir=c:\data"

  8. mvnw clean test

Git command

  1. git init (initial a local repo, doesn't link to remote yet)

  2. git remote add origin https://github.com//.git

  3. git add * (add new/updated files to be commited into local repo)

  4. git status (to check files that are going to commit into local repo)

  5. git commit -m "" (commit new/updated files to local repo)

  6. git push -u origin master (create a master branch in github and push the code to github master branch)

  7. <don't develop in master branch - final/latest working baseline>

  8. git checkout -b develop master (clone a copy from master to develop branch locally)

  9. git push -u origin develop (push from local develop branch to github develop branch)

  10. git checkout develop (to switch between branches)

  11. git branch -a (show all local branches and remote branch refernces)

  12. git branch (show all local branches)

  13. git add *

  14. git commit -m ""

  15. git push -u origin develop (push code on local develop branch to github develop branch)

  16. git checkout master

  17. git merge develop (after changes in develop branch are complete without errors, in master branch, merge changes from develop branch)

  18. git push -u origin master (in master branch to push merged changes from develop branch to github master branch)

##Deploy to heroku (must be on master branch locally and remote)

  1. Create/use an existing heroku account

  2. On your project root, you need a system.properties file.

  3. put the following line in system.properties files. java.runtime.version=18

  4. git add *

  5. git commit -m "added/updated system.properties"

  6. git push -u origin master

  7. heroku login (in your terminal window/command prompt in the project root directory)

  8. heroku apps:create

  9. git remote -v (all remote branches. you should see refernce URL to heroku)

  10. git push -u heroku master

Git reset reference

https://www.w3docs.com/learn-git/git-reset.html

echo 'new file content' > test_file

echo 'append content' >> edited_file

git add test_file edited_file

git status

git ls-files -s

git reset HEAD

git add test_file edited_file

git commit -m "added test_file edited_file"

git log

git reset --soft xxxxxxxxxxx

git reset --hard

Tagging

https://initialcommit.com/blog/git-tag#:~:text=A%20tag%20is%20technically%20a%20type%20of%20ref,git%20tag%20v1.0.0%20%24%20git%20tag%20--list%20v1.0.0

git tag -a v1.0.0

git tag --list

git push --tags

git ls-remote --tags

EPAT Aug19"# nus-git-workshop"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published