Skip to content

Instantly share code, notes, and snippets.

@shrikanthkr
Last active May 6, 2018 19:48
Show Gist options
  • Save shrikanthkr/a9118107bc32fd032c26c84ec4e659cc to your computer and use it in GitHub Desktop.
Save shrikanthkr/a9118107bc32fd032c26c84ec4e659cc to your computer and use it in GitHub Desktop.
simple git commands
<h2>ReadMe<h2>
<h4>General Git Commands</h4>
https://www.git-tower.com/blog/git-cheat-sheet/
> git clone `<project-url>`
>
> git checkout `<branch-name>` -- to checkout a branch
>
> git checkout -b `<branch-name>` -- to create a branch>
>
> git pull origin `<branch-name>` -- pull from a specified branch
<h4>Steps to commit a change</h4>
>git add -A -- adds all the files
>
>git commit -m 'My commit message'
>
>git push origin `<branch_name>`
Note: <b>Do not force push at any instance <b>
<h4>Rails Commands</h4>
>rails s - start the server
>
>rails g controller `<controller_name>` -- should be in plural like `rails g controller users`
>
>rails g model `model_name` -- should be singular
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment