git fetch git fetch is the command that tells your local git to retrieve the latest meta-data info from the original (yet doesn't do any file transferring. It's more like just checking to see if there are any changes available).
git pull git pull on the other hand does that AND brings (copy) those changes from the remote repository.
git branch -d <branch_name>: delete local branch (use -D for force)
git diff --staged
git diff-tree --no-commit-id --name-only -r <commit_id> Committed file names only
git rm --cached <filename>
git mv <old name> <new name>
git log Viewing the Commit History
git show <commit_id> View commit diff
Compare 2 branches
One line per commit git log remotes/origin/release/v7.1.0..remotes/origin/release/v7.2.0 --pretty=oneline
Full comments git log remotes/origin/release/v7.1.0..remotes/origin/release/v7.2.0
How to “sync” locally:
Suppose you make a new branch (new_branch) deriving from branch “base_branch”
You do your work and make some commits to new_branch.
Meanwhile, others have merged changes into base_branch
When it comes time to merge new_branch into base_branch you need to Sync.
To sync new_branch with base_branch:
checkout base_branch and run git pull
checkout new_branch and run git merge base_branch
Resolve any conflicts that appear, add all relevant files with git add then git commit
Your branch is now synced with base_branch and you can make a PR with confidence that the CI will succeed (or at least not fail due to conflicts)
Fixing conflicts: From CLI, run the following, based on this link:
Enter into your repository: cd ~/<repo_directory>
Pull the latest version into your local rep: git pull
Checkout into your feature branch (the branch which include the fix you wanted to merge): git checkout <feature_branch>
Attempt to merge the files locally, in order to trigger a failure: git pull origin <destination_branch>
You will receive a list of files which has conflicts. You have the options: Either edit each file (using pycharm for example), and determine what should be the correct version. Use the tool from pycharm: VCS → Git → “Resolve Conflicts”, then, you can choose the correct version.
Once done, proceed to merge your code again: $ git add <filename>
$ git commit -m'commit message'
Push your change using your branch name: git push origin <feature_branch>
Server
Restart automation services sudo service indeni-automation status
SHOW FULL TABLES; SHOW TABLES; SHOW TABLES LIKE 'alert'; SHOW databases; SELECT * FROM alert; SELECT [*] FROM [TableName] WHERE [condition1] [AND [OR]] [condition2]...
SELECT column_name() FROM table_name ORDER BY column_name() ASC or DESC
Add the following lines to the end of the parser script to get the input data from the file and check the parser operation: FILE_PATH_RAW_DATA = "test_file_path"
f = open(FILE_PATH_RAW_DATA, "r")
raw_data = f.read()
f.close()
helper_methods.print_list(ClassName().parse(raw_data, {}, {}))