Saturday, January 27, 2018

Git Workflow and commands | Git popular commands


git init

This command turns a directory into an empty Git repository. This is the first step in creating a repository. After running git init, adding and committing files/directories is possible.

git add

Adds files in the to the staging area for Git. Before a file is available to commit to a repository, the file needs to be added to the Git index (staging area). There are a few different ways to use git add, by adding entire directories, specific files, or all unstaged files.

git commit

Record the changes made to the files to a local repository. For easy reference, each commit has a unique ID.
It’s best practice to include a message with each commit explaining the changes made in a commit. Adding a commit message helps to find a particular change or understanding the changes.

git status

This command returns the current state of the repository.

git clone

To create a local working copy of an existing remote repository, use git clone to copy and download the repository to a computer.

git fork
A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.

git pull
To get the latest version of a repository run git pull. This pulls the changes from the remote repository to the local computer.

git push

Sends local commits to the remote repository. git push requires two parameters: the remote repository and the branch that the push is for.

git checkout

To start working in a different branch, use git checkout to switch branches.

git merge

Integrate branches together. git merge combines the changes from one branch to another branch. For example, merge the changes made in a staging branch into the stable branch.

git commit --amend

You can also re-write history of your most recent commit in your local git repository by using git commit --amend command.

git commit --amend

sudo: no tty present and no askpass program specified - How to fix no tty present and no askpass program specified error?

You may get this error during deployment to Tomcat from Jenkins. 
The fix for deployment to Tomcat from Jenkins is:

type --> sudo visudo
look for root and make the changes highlighted in red and save the file and re-do the deployment in Jenkins.

# User privilege specification 


root ALL=(ALL:ALL) ALL 
jenkins ALL=(ALL) NOPASSWD: ALL

Thursday, January 25, 2018

How to resize memory in EC2 instance in AWS?

Please find steps below to increase or decrease memory for the EC2 instances. For example, if your t2.micro instance is too small for its workload, you can change it to an m3.medium instance.

1. Go to AWS console, choose the instance, instance state, click on stop the instance.
2. once stopped, go to Instance settings, change Instance type to desired type
3. Start the instance again.

That's it. You don't have to create a new instance. This is how you do it!