GitHub
📝 18 Prompts
📚 Prompts in this Group
Learn these prompts step by step to master this theme
1
Force GitHub main to overwrite changes
Git Force Synchronization
What specific Git command is used to discard all local commits and uncommitted changes, effectively forcing your local branch to match the exact state of the main branch on the remote server?
~git reset --hard origin/main~
2
force the specific branch to overwrite GitHub main
What Git command should you use when you need to forcefully update the remote main branch on origin with your local changes, even if it overwrites the remote history?
~git push --force origin main~
3
Get authentication
What GitHub CLI command would you run to start the process of signing in and authenticating your account from the terminal?
~gh auth login~
5
git commit -m
What Git command do you use to see the exact line-by-line changes made to a specific file since the last commit, without staging or saving anything?
~git commit -m "message"~
6
Git Create Repository
What sequence of terminal commands would you use to check for an existing Git repository, initialize one if needed, stage your files, create the first commit, authenticate with GitHub, and then create and push a new public repository to GitHub from the current folder?
# 1. Check if a git repo already exists
~git status~
# 2. Initialize a new git repository
~git init~
# 3. Stage all files for tracking
~git add .~
# 4. Commit staged files with a message
~git commit -m "Initial commit"~
# 5. Authenticate with GitHub (one-time)
~gh auth login~
# 6. Create the repo on GitHub & link it
~gh repo create <name> --public --source=.~
# 7. Push your code to GitHub
~git push -u origin master~
8
git diff filename
What Git command do you use to see the exact line-by-line changes made to a specific file since the last commit, without staging or saving anything?
~git diff filename~
9
git log
What Git command do you use to save a snapshot of your staged changes locally, while including a short descriptive message inline that explains what was done?
~git log~
12
git show HEAD
What Git command do you use to view the full details and the specific content changes introduced by the very last commit made in your current branch?
~git show HEAD~
13
GitHub connect a specific branch to the main branch
What sequence of Git and terminal commands would you use to move into a local project folder, initialize a repository, create the first commit, connect it to a GitHub remote, rename the branch to main, and force push it upstream?
cd "C:\Users\victo\Local Sites\abu-amra"
~git init~
~git add .~
~git commit -m "Initial commit"~
~git remote add origin~ https://github.com/victorystreamlines/abu-amra.git
~git branch -M main~
~git push --force -u origin main~
14
GitHub version
What Windows Package Manager command would you use to see whether the installed package with the exact ID for GitHub CLI appears on your system?
~winget list --id GitHub.cli~
15
Install GitHub
What is the full winget command you would use to install the GitHub CLI by specifying its package identifier?
~winget install --id GitHub.cli~
16
npm install
Which command do you run in your terminal to download and set up all the dependencies listed in a project's package.json file?
~npm install~
17
push changes to GitHub
To push changes back to GitHub, you'd need to run git commands manually:
~git add .~
~git commit -m "your message"~
~git push~
18
UnInstall GitHub
What is the complete Windows Package Manager command used to remove the GitHub CLI tool by specifying its exact package identifier?
~winget uninstall --id GitHub.cli~