The above command only shows the names of remotes. To also check the links to the remotes:

git remote -v

Now this is very important command.

git remote update

This will contact the git server, and will update the local repository with ALL the content at ALL those remotes. The interesting part is, nothing will actually change. That is, no more new branches (which got created at the server after you last pulled from the server) were created, and the existing branches are also not updated. BUT, all the content goes into the magic .git directory. After you’ve run this command, when you create a branch only existing at remote, the local git repo will not contact the server but will fetch all the contents from within the repository.

To take a new branch from remote, and create a new branch having contents of that remote branch. (You might need to run ‘git remote update’)

git checkout -b stable/cinder origin/stable/cinder

Push

Pushing this newly created branch to remote swamireddy

git push swamireddy my_branch

If you want to push the local branch my_branch with a different name to remote, say my_remote_branch:

git push swamireddy my_branch:my_remote_branch

To create an association with the remote (only first time):

git push -u origin my_branch

or

git push --set-upstream origin my_branch

Pull

Git pull is nothing more than a macro that does git fetch and git merge, in that order. The common syntax to pull from branch remote_branch located at remote remote_name to the current active branch in the local repo:

git pull remote_name remote_branch

Oops! I didn’t intend to do that!

####To undo last commit. This will just undo the commit, but will keep changes, so that you can modify the files and commit again

git reset --soft HEAD^

####To not keep the uncommitted changes. This command will wipe off all the changes which are not committed. Very useful when you made some changes but dont want to commit it. All the more useful when you pulled something but everything became a mess (possibly due to a merge conflict, or pulling to/from a different branch!)

git reset --hard

####To delete a branch testing from github server

git push swamireddy --delete testing

(NOT git push swamireddy --delete swamireddy/testing)

####Change author of the last commit

git commit --amend --author="Swami Reddy MR <swamireddy@gmail.com>"

You committed some changes, but then you realised you wanted to add this one line to the commit. In such a case just add that one line, and run this command to have this last change incorporated into that previous commit. This command also gives you an option to change the commit message.

git commit -a --amend

Show me the money

To see the patch of the last commit without undoing the last commit

git show

To see the changes introduced by any earlier commit with commit id c5bb6d821e10ca8f114fa0b3b0149bc8b7257a92

git show c5bb6d821e10ca8f114fa0b3b0149bc8b7257a92

To see the latest changes you made – the changes which have not been staged to be committed

git diff

You can redirect the output from the above three commands to a file, to create corresponding patch file.

Patching in git

Check the status of patch. How many lines changed, etc

git apply --stat patchfile

Check if the patch can be applied. If no output or no error, patch can be applied safely

git apply --check patchfile

Apply patch with signing-off (better way)

git am --signoff < patchfile

Normal way of applying patch

git apply patchfile

##Miscellaneous

To pull only specific files from another branch: (here, assuming that we have two branches, ‘test’, and ‘master’, and currently we are on ‘master’ branch. If you want to pull ##only ‘testfile.py’ file from ‘test’ branch to ‘master’ branch, do this:)

git checkout test testfile.py1

If your master changed while you were working on your topic_branch, and if you want to merge the master’s changes, and also get an option to squash the changes you made on topic_branch:

NOTE: the above files, permission may be required to change with ceph:ceph as below:

# chown ceph:ceph journal jounral_dmcrypt

Now, create osd journal as below:

# ceph-osd --mkjournal -i <id>

Now, start the osd as below:

#systemclt start ceph-osd@<id>

OSD should be up and in with new journal.

]]>https://swamireddy.wordpress.com/2017/10/11/ceph-how-to-add-the-ssd-journal-with-dm-crypt-enabled/feed/0swamireddyCeph: mon is down and/or can’t rejoin the quorumhttps://swamireddy.wordpress.com/2017/09/20/ceph-mon-is-down-andor-cant-rejoin-the-quorum/
https://swamireddy.wordpress.com/2017/09/20/ceph-mon-is-down-andor-cant-rejoin-the-quorum/#respondWed, 20 Sep 2017 13:54:41 +0000http://swamireddy.wordpress.com/?p=2552Continue reading Ceph: mon is down and/or can’t rejoin the quorum]]>Sometimes, we have seen that a Ceph mon down and could not rejoin the ceph mon quorum, even though that specific ceph mon is up and running (along with ceph-mon process is also up and running).

A quick solution as below:

As one ceph mon is down and out of quorum, then its safe to remove the down mon node from the quorum with below steps:

Pre-requisites: Connect to ceph mon node (or controller node, where down ceph mon is installed and check if its running or not using “ps -ef | grep ceph-mon”. [ If its running with nonresponsive, then stop/kill this process]. The output of this “ps” command should be empty.

]]>https://swamireddy.wordpress.com/2017/08/14/ceph-increase-osd-start-timeout/feed/0swamireddyCeph: Whats new in this releasehttps://swamireddy.wordpress.com/2017/08/02/ceph-whats-new-in-this-release-2/
https://swamireddy.wordpress.com/2017/08/02/ceph-whats-new-in-this-release-2/#respondWed, 02 Aug 2017 10:08:21 +0000http://swamireddy.wordpress.com/?p=2422Continue reading Ceph: Whats new in this release]]>Here is the quick list of new features/functionalities added in ceph releases.

Please find the more details on each release with LTS and its retirement dates Ceph release

BlueStore backend for ceph-osd is now stable.
There is a new daemon, ceph-mgr, is a required part of any Ceph deployment.
Multiple active MDS daemons is now considered stable.
The ceph status (ceph -s) command has a fresh look.
S3 bucket lifecycle API has been added.

#sysctl -w net.netfilter.nf_conntrack_max=1048576#echo 24576 > /sys/module/nf_conntrack/parameters/hashsize
And add the below line to /etc/modprob.conf
options io_conntrack_hashsize=24576
Note: hashsize can be nf_conntrack_max by 4 or 8.

]]>https://swamireddy.wordpress.com/2017/04/18/cloud-nodes-nf_conntrack_max-recommendations/feed/0swamireddyCeph: Reduce the pg number on a poolhttps://swamireddy.wordpress.com/2017/04/18/ceph-reduce-the-pg-number-on-a-pool/
https://swamireddy.wordpress.com/2017/04/18/ceph-reduce-the-pg-number-on-a-pool/#respondTue, 18 Apr 2017 13:01:23 +0000http://swamireddy.wordpress.com/?p=2085Continue reading Ceph: Reduce the pg number on a pool]]>Why the pg number required to be reduced?