Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Commit and push Changes to remote Git Repository

The following OS and Git commands are used:

Code Block
languagepowershell
titleExample how to commit and push changes to a remote repository
linenumberstrue
# Find the repository folder managed by JOC Cockpit
cd /var/sos-berlin.com/js7/joc/jetty_base/resources/joc/repositories/rollout/Accounting

# Follows the Git integration part
git add .
git commit -m "changes to accounting jobs for v12.3"
git push

...

There are a number of ways how to do achieve this using Git commands:

Code Block
languagepowershell
titleExample how to pull changes to a local Git repository
linenumberstrue
# add the old repo as a remote repository 
git remote add oldrepo https://github.com/path/to/oldrepo

# get the old repo commits
git remote update

# examine the whole tree
git log --all --oneline --graph --decorate

# copy (cherry-pick) the commits from the old repo into your new local one
git cherry-pick sha-of-commit-one
git cherry-pick sha-of-commit-two
git cherry-pick sha-of-commit-three

# check your local repo is correct
git log

# send your new tree (repo state) to github
git push origin master

# remove the now-unneeded reference to oldrepo
git remote remove oldrepo

Pull Changes to local Git Repository

The following OS and Git commands are used:

Code Block
languagepowershell
titleExample how to pull changes to a local Git repository
linenumberstrue
# Find the repository folder managed by JOC Cockpit
cd /var/sos-berlin.com/js7/joc/jetty_base/resources/joc/repositories/rollout/Accounting

# Pull changes
git pull

...