{"id":14955728,"url":"https://github.com/jasnow/practice-git-with-rails","last_synced_at":"2025-10-01T01:31:27.709Z","repository":{"id":41092870,"uuid":"10207253","full_name":"jasnow/Practice-Git-with-Rails","owner":"jasnow","description":"Practice Git on a Rails repo","archived":false,"fork":false,"pushed_at":"2023-04-17T12:57:26.000Z","size":495,"stargazers_count":8,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-14T11:46:49.674Z","etag":null,"topics":["rails-application","tutorial"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasnow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-21T23:00:49.000Z","updated_at":"2023-07-19T02:54:42.000Z","dependencies_parsed_at":"2024-09-24T13:24:03.986Z","dependency_job_id":null,"html_url":"https://github.com/jasnow/Practice-Git-with-Rails","commit_stats":{"total_commits":1135,"total_committers":12,"mean_commits":94.58333333333333,"dds":"0.016740088105726914","last_synced_commit":"1a638600dc0709a5515f1a1b2d862e0c4881b06a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasnow%2FPractice-Git-with-Rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasnow%2FPractice-Git-with-Rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasnow%2FPractice-Git-with-Rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasnow%2FPractice-Git-with-Rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasnow","download_url":"https://codeload.github.com/jasnow/Practice-Git-with-Rails/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234808946,"owners_count":18890088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rails-application","tutorial"],"created_at":"2024-09-24T13:11:38.217Z","updated_at":"2025-10-01T01:31:27.361Z","avatar_url":"https://github.com/jasnow.png","language":"Ruby","readme":"Git Your Practice On with Rails!\n============\n\n** Please do not change the database from sqlite3 in dev/test.**\n\n(originally part of PHP repo: https://github.com/grayghostvisuals/Practice-Git)\n\n* Git Reference [http://gitref.org/basic](http://gitref.org/basic)\n* Pro Git Online Book [http://git-scm.com/book](http://git-scm.com/book)\n* Git Ready [http://gitready.com](http://gitready.com)\n* Quick Command Practice [http://try.github.com](http://try.github.com)\n* Git Real [http://www.codeschool.com/courses/git-real](http://www.codeschool.com/courses/git-real)\n* How to GitHub: Fork, Branch, Track, Squash and Pull Request [http://gun.io/blog/how-to-github-fork-branch-and-pull-request](http://gun.io/blog/how-to-github-fork-branch-and-pull-request)\n* Learn Git Online [http://learn.github.com/p/intro.html](http://learn.github.com/p/intro.html)\n* Git: The Simple Guide [http://rogerdudler.github.com/git-guide](http://rogerdudler.github.com/git-guide)\n* Git Immersion [http://gitimmersion.com](http://gitimmersion.com)\n\nMy References:\n * http://pcottle.github.io/learnGitBranching\n * http://net.tutsplus.com/articles/general/team-collaboration-with-github\n * https://github.com/GarageGames/Torque2D/wiki/Pull-Requests-Coding-Standards\n * https://github.com/skyscreamer/yoga/wiki/GitHub-Best-Practices\n * http://codeinthehole.com/writing/pull-requests-and-other-good-practices-for-teams-using-github\n * http://blog.8thcolor.com/2013/05/git-tips-and-tricks-2\n\nWelcome to my practice git repository where you can change up as much as\nyou'd like plus work with a real, living, breathing person on the other side.\nHere we learn all things git. Feel free to send me Pull Requests just\nto discover what it's like when a Repo Maintainer asks you.\n\n\u003cblockquote\u003e\n\"Can you squash your commits for us\"\n\u003c/blockquote\u003e\n\nand you're all like...\n\n\u003cblockquote\u003e\n\"How the hell do I do that?\"\n\u003c/blockquote\u003e\n\nThis is where we make those mistakes ... so don't be scared :)\n\n##Instructions (Contributing)\n\nFork this repo and send me a Pull Request with anything from Grandma Peggy's\nCrumbled Oatmeal Cookie Recipe to your favorite Sublime Text 2 preferences.\nIt's all good yo! Learning is the prize in this game.\n\n## Typical and highly useful git commands\n\n``git clone git@github.com:\u003cuser_name\u003e/the-repo-you-are-cloning.git``\n* Clones your remote origin repo locally\n\n``git fetch upstream``\n* Pulls in the remote changes not present in your local repo. Downloads objects and references from another repository.\n\n``git merge upstream/main``\n* Merges any changes fetched into your working files\n\n``git add \u003cfile\u003e``\n* Start tracking new files and also stage changes to already tracked files\n\n``git status`` and ``git diff``\n* Tells us what files and assets have been modified and staged\n\n``git status -s``\n* This will display what files have been removed, changed or modified.\n* (M)  - modified\n* (A)  - added\n* (AM) - file has not been altered since it was last added\n\n``git commit -m 'the message goes here for the commit'``\n* Records a snapshot of the project into your history at the time of your commit.\n\n``git add '*.\u003cfile_extension\u003e'``\n* This command adds all file types with the same extension, especially from different directories. Without quotes the command will only execute within the same directory it's been called from.\n\n``git rm --cached \u003cfile\u003e``\n* Unstages a file from the working tree (i.e. stops tracking the file).\n\n``git log``\n* Remembers all the changes we've committed so far, in the order we committed them.\n\n``git log --summary``\n* See where new files were added for the first time or where files were deleted.\n\n``git remote add origin git@github.com:\u003cuser_name\u003e/\u003crepo_name\u003e.git``\n* Creates a brand new remote repository.\n\n``git remote -v``\n* Show a list of the current remote repositories\n\n``git reset \u003cfile\u003e``\n* Removes the desired file from staging area.\n\n``git branch -r``\n* List all the remote branches currently tracked\n\n``git remote prune origin``\n* Deletes branch locally if it has been removed remotely. Helps to remove stale references.\n\n``git checkout \u003ctarget\u003e``\n* Changes the desired target back to the state of the last commit. A target can be a file or a directory (for example).\n\n``git rebase``\n* Rebase allows you to [easily change a series of commits, reordering, editing, or squashing commits together into a single commit](https://help.github.com/articles/interactive-rebase).\n* Be warned: it's considered bad practice to rebase commits which you have already pushed to a remote repo. Doing so may invoke the wrath of the git gods. [https://help.github.com/articles/interactive-rebase](https://help.github.com/articles/interactive-rebase)\n\n##Adding\n``git add \u003clist of files\u003e``\n(i.e. git add read me.md license.txt. Can be multiples)\n\n``git add --all``\nAdd all the new files since last\n\n``git add *.txt``\nAdd all txt files in directory\n\n##Staging\n``git diff``\nShow unstated differences since last commit\n\n``git diff --staged``\nGets the staged differences and doisplays what has changed since our last commit\n\n##Reverting\n``git reset HEAD \u003cfile\u003e``\nHead is the last commit on the current branch we are on. What if you stage something you didn't need to be staged? This is the key\n\n``git checkout -- \u003cfile\u003e``\nBlow away all changes to a file since last commit\n\n``git reset --soft HEAD^``\nWhat if you regret commit? This will undo your last commit. (^ means move commit before HEAD and puts changes into staging).\n\n``git reset --hard HEAD``\nUndo Last commit and all changes\n\n``git commit --amend -m \"added another file to the commit'``\nNew commit message will override previous commit message\n\n##Remotes\n\"Remotes are kinda like bookmarks\"\n\n``git remote -v``\nShow the current remote repos\n\n``git remote add \u003cname\u003e \u003caddress\u003e``\nAdd a new remote repo\n\n``git remote rm \u003cname\u003e``\nRemove remote repo\n\n##Cloning, Branching, Fetching \u0026amp; Merging\n``git fetch``\nPulls down any changes but doesn't merge them\n\n``git branch \u003cbranch name\u003e``\nMakes a new branch\n\n``git checkout \u003cbranch name\u003e``\nSwitching branch and on a different timeline\n\n``git merge \u003cbranch\u003e``\nMerges branch into main\n\n``git branch -d \u003cbranch name\u003e``\nDeletes branch\n\n``git checkout -b \u003cbranch name\u003e``\nCreates a new branch and then switches to it\n\nVI Editor Quick Key Exit\n``:wq + enter``\n\n##Pushing \u0026amp; Pulling\n``git push -u origin main (remote repo name, local branch name) -u``\nLets you just run git push later on without specifying name and branch\n\n``git pull``\nPull changes in and syncs up your repo\n\n``git pull``\nFetches or syncs local with remote repo. Doesn't update local code\n\n##Branching\n``git branch -r``\nList all remote branches\n\n``git remote show origin``\nShow all the remote branches\n\n``git push origin :\u003cbranch name\u003e``\nDeletes the remote branch\n\n``git branch -D \u003cbranch name\u003e``\nDelete the local repo branch and if you don't want the commits any longer on it then delete them too.\n\n``git remote prune origin``\nDeletes the branch locally if it has been removed remotely. Helps to remove stale references.\n\n##Rebasing\n\"Merge commits are bad\"\n\n``git rebase``\nMove all changes to main local which are not in origin/main remote to a temporary area\n\n##History\n``git log``\nViewing the commits history\n\n``git config --global color.ui true``\nColor codes the commit SHA\n\n``git log --pretty=oneline`` or ``git log --graph --oneline --all``\nCommit and history is one line\n\n``git log --pretty=format:\"%h``\nExactly how you want the output using placeholders ( use git help log )\n\n``Date Ranges``\nGit log --until\n\n##Removal\n``git rm \u003cfilename\u003e``\nRemoves file completely\n\n``git rm --cached \u003cfile names\u003e``\nWon't be deleted from your file system just keeps the local changes still\n\n##Help\n``git help``\n``git help \u003ccommand\u003e``\n\n\n##Suggestions\n * Add .ruby-version\n * Add .ruby-gemset\n * Remove public/index.html file\n * Add \"1 == 1\" test.\n * Add \"1 == 1\" rspec spec.\n * Set up and deploy to Heroku.\n\n**Enjoy**\n\n3. Push it back to Github.\n\n##DISCUSSION\n\nIf you have questions, please use this [Linkedin group](http://www.linkedin.com/groups/Atlanta-Ruby-Users-Group-106945/about)\n\n##License\n\nThis repo is released under the [MIT License.](MIT-LICENSE.txt)\n\nhttp://www.opensource.org/licenses/mit-license\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasnow%2Fpractice-git-with-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasnow%2Fpractice-git-with-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasnow%2Fpractice-git-with-rails/lists"}