{ "cards":[ { "front": "Cmd to display what version of git is installed", "back": "git --version" }, { "front": "Cmd to display where git is installed.", "back": "which git" }, { "front": "Steps to clone a github repository to desktop on Mac.", "back": "cd desktop\non Github.com select \"Clone or download\"\nSelect copy to clipboard https\non cmd line git clone https://to path" }, { "front": "Cmd to navigate in child directory", "back": "cd NameOfDirectory" }, { "front": "Cmd to list contents of directory.", "back": "ls" }, { "front": "Cmd to show a list of most recent commits.", "back": "git log( uses 'less' which is a program to display text)\nescape by pressing 'q'" }, { "front": "Create a file with VIM", "back": "vim filename" }, { "front": "To insert text into a VIM editing session", "back": "Shift-Insert." }, { "front": "Steps to fork and clone github repository.", "back": "select fork on github repository\nselect forked copy https://.." }, { "front": "Pull request need to be ", "back": "forked first" }, { "front": "Cmd to move up a directory", "back": "cd .." }, { "front": "Cmd to remove a directory, that isn't empty.", "back": "rm -rf DirectoryToRemove" }, { "front": "Confirm clone is a fork", "back": "git remote -v" }, { "front": " Cmd to clear screen", "back": "clear" }, { "front": "Create a repository", "back": "mkdir NewDirectory\ncd NewDirectory\ngit init" }, { "front": "Cmd to list contents of directory including hidden files", "back": "ls -la" }, { "front": "Find the status of new files , files to be commited to repository", "back": "git status" }, { "front": "2 files that shoud be added to new respositories.", "back": "readme and license" }, { "front": "Web site to find license information", "back": "choosealicense.com" }, { "front": "Git configuration file", "back": "git config --list" }, { "front": "Git adding a file to be commit", "back": "git add " }, { "front": "Git command to add all files.", "back": "git add ." }, { "front": "VIM editor to save and escape", "back": "escape key \"wq" }, { "front": "Commiting files after git add", "back": "git commit\nopens defaut editor, save and commit" }, { "front": "Git command to commit with a message.", "back": "git commit -m \"message here\"" }, { "front": "Git command to list commits.", "back": "git log " }, { "front": "Git configuration options", "back": "git config --list" }, { "back": "git config user.name \"YourUserName\"" }, { "front": "Git configurations local or global", "back": "git config --local or --global --list" }, { "front": "Git readme files", "back": "README.md" }, { "front": "CMD to print file to screen", "back": "cat " }, { "front": "Hidden file that shows this is a Github clone", "back": ".git " }, { "front": "List all remotes associated with current repo", "back": "git remote -v" }, { "front": "What is a branch?", "back": "A branch in Git is simply a lightweight movable pointer to one of these commits. The default branchname in Git is master. As you initially make commits, you're given a master branch that points to the last commit you made. Every time you commit, it moves forward automatically." }, { "front": "How is a branch created?", "back": "A branch is created when you fork a repository." }, { "front": "List branches and remote branches being tracked.", "back": "git branch -vv" }, { "front": "Shows all branches local and remote", "back": "git branch -vv -all" }, { "front": "Shows all commits.", "back": "git log --oneline" }, { "front": "To add a local to a repository", "back": "git remote add origin " }, { "front": "Adding a new extra remote to repo(not origin)", "back": "git remote add \"anyname\" https://github.com/.....\ngit remote -v (will show the anyname and path of remote, Still need to fetch)\ngit fetch anyname" }, { "back": "git log --oneline --decorate --all --graph" }, { "front": "To push local changes to origin (could be asked for id/password) -pushing.", "back": "git push origin master" }, { "front": "Adding a local to a repository -pushing.", "back": "git remote -vv\ngit remote add origin\ngit push --set-upstream origin master" }, { "front": "Git command to see differences in files.", "back": "git diff" }, { "front": "Git command to see diferences between commit", "back": "git log -p" }, { "front": "Steps to add a directory because Git doesn't track directories only files", "back": "mkdir name\ntouch name/.keep\ngit add .\ngit commit -m \"comment to add\"\ngit status\ngit log" } ] }