SlideShare une entreprise Scribd logo
1  sur  21
+ +Presented by
Introduction to Git and GitHub
AGENDA
1. Introduction to Version Control System
- What is Version Control System
- Centralised vs Distributed Version Control Systems
2. Introduction to Git
- What is Git
- Configuring Git and Creating repositories
- Add, commit, push
- The .gitignore file
- Branches
- Synchronising changes and Make changes
3. Introduction to GitHub
- What is GitHub
- Collaborating using Git and GitHub
Version Control System
- A way to manage files and directories
- Track changes over time
- Recalls previous versions
Centralised vs Distributed VCS
Git
What is Git?
Git is distributed version
control software.Git
repository has a copy of
that entire repository -
every commit, every
branch, every file.
Why use Git
● Speed
● Merge Conflicts
● Cheap Branches
● Ease of roll back
Configure Tooling
Configure user information for all local repositories
$ git config --global user.name "[name]"
Sets the name you want attached to your commit transactions
$ git config --global user.email "[email address]"
Sets the email you want attached to your commit transactions
⚙
Creating Repository
When starting out with a new repository, you only need to do it once; either
locally, then push to GitHub, or by cloning an existing repository.
$ git init
Or
$ git clone [url]
Clone (download) a repository that already exists on GitHub,
including all of the files, branches, and commits
git add
The git add command adds new or changed files in your working directory to the Git
staging area.
Few commonly used git add commands are:
$ git add <path>
Stage a specific directory or file
$ git add .
Stage all files (that are not listed in the .gitignore) in the entire repository
$ git add -p
Interactively stage hunks of changes
git status
$ git status shows the current state of your Git working directory and staging
area.
Why use git status?
The git status command only outputs information, it won't modify commits or changes
in your local repository.
What kind of information do we get?
Where HEAD is pointing, whether that is a branch or a commit .
If changed files are staged or not
git commit
git commit creates a commit, which is like a snapshot of your repository.
These commits are snapshots of your entire repository at specific times. It
should tell a story of the history of your repository and how it came to be the
way that it currently is.
How to use git commit?
git commit -m "descriptive commit message"
git commit -am "descriptive commit message"
git commit --amend
The .gitignore file
A .gitignore file is a plain text file where each line
contains a pattern for files/directories to ignore.
Generally, this is placed in the root folder of the
repository. You can also have multiple .gitignore files.
Why use .gitignore?
It is too easy to accidentally commit files containing
sensitive information or unnecessary files. The .gitignore
file comes in handy, escaping from these accidents.
https://www.toptal.com/developers/gitignore -> This link
can be used to generate .gitignore files effortlessly.
git push
$ git push uploads all local branch commits to the corresponding
remote branch. You can think of git push as “update” or “publish”. It only
updates the corresponding branch on the remote.
Common usages for git push
● $ git push -f
● $ git push -u origin [branch]
● $ git push --all
Branches
A branch in Git is simply a lightweight movable pointer to one of these commits. The
default branch name in Git is master . As you start making commits, you're given a
master branch that points to the last commit you made. Every time you commit, the
master branch pointer moves forward automatically.
Creating a New Branch
$ git branch <branch name>
Switching Branches
To switch to an existing branch, you run the git checkout command.
$ git checkout <branch name>
This moves HEAD to point to the <branch name> branch.
git pull
git pull updates your current local working branch, and all of the remote
tracking branches.
Common usages and options for git pull
● $ git pull
● $ git pull --rebase
● $ git pull --force
● $ git pull --all
Synchronising changes
$ git fetch
Downloads all history from the remote tracking branches
$ git merge
Combines remote tracking branches into current local branch
Make changes
$ git log
Lists version history for the current branch
$ git log --follow [file]
Lists version history for a file, including renames
$ git diff [first-branch]...[second-branch]
Shows content differences between two branches
$ git show [commit]
Outputs metadata and content changes of the specified commit
How to Undo Commits in Git
$ git revert
git revert looks at the changes introduced in a specific commit,
then applies the inverse of those changes in a new commit.
$ git reset
git reset is a very powerful command that may cause you to lose
work. By resetting, you move the HEAD pointer and the branch
pointer to another point in time - maybe making it seem like the
commits in between never happened
Introduction to GitHub
GitHub is a repository hosting platform for version
control system git. It lets you and others work together
on projects from anywhere.
Collaborating with GitHub
Adding collaborators in GitHub repository
A. On GitHub, navigate to the main
page of the repository.
B. Under your repository name,
click Settings.
C. In the left sidebar, click Manage
access.
D. Click Invite a collaborator and
Add NAME to REPOSITORY.
E. The user will receive an email
inviting them to the repository.
Presented by
The End

Contenu connexe

Tendances (19)

Git and github
Git and githubGit and github
Git and github
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
 
Advance workshop on git
Advance workshop on gitAdvance workshop on git
Advance workshop on git
 
Git commands
Git commandsGit commands
Git commands
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Git Tricks
Git TricksGit Tricks
Git Tricks
 
Git tutorial undoing changes
Git tutorial   undoing changesGit tutorial   undoing changes
Git tutorial undoing changes
 
Extra bit with git
Extra bit with gitExtra bit with git
Extra bit with git
 
Git for developers
Git for developersGit for developers
Git for developers
 
Git cheatsheet
Git cheatsheetGit cheatsheet
Git cheatsheet
 
Git in 5 Minutes
Git in 5 MinutesGit in 5 Minutes
Git in 5 Minutes
 
Git basic
Git basicGit basic
Git basic
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git rewriting git history
Git   rewriting git  historyGit   rewriting git  history
Git rewriting git history
 
Version controll.pptx
Version controll.pptxVersion controll.pptx
Version controll.pptx
 
Git 101 Workshop
Git 101 WorkshopGit 101 Workshop
Git 101 Workshop
 

Similaire à Hacktoberfest intro to Git and GitHub

Git slides
Git slidesGit slides
Git slidesNanyak S
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?9 series
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | WorkshopAnuchit Chalothorn
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践Terry Wang
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with gitDídac Ríos
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 
Git_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_GuidewireGit_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_GuidewireGandhi Ramu
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__greyKing Hom
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__whiteKing Hom
 

Similaire à Hacktoberfest intro to Git and GitHub (20)

Git slides
Git slidesGit slides
Git slides
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git github
Git githubGit github
Git github
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git 101
Git 101Git 101
Git 101
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Learn Git Basics
Learn Git BasicsLearn Git Basics
Learn Git Basics
 
Git and Github - A primer
Git and Github - A primerGit and Github - A primer
Git and Github - A primer
 
Git
GitGit
Git
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Git 入门 与 实践
Git 入门 与 实践Git 入门 与 实践
Git 入门 与 实践
 
Git basics for beginners
Git basics for beginnersGit basics for beginners
Git basics for beginners
 
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
 
Learning git
Learning gitLearning git
Learning git
 
Git_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_GuidewireGit_and_GitHub Integration_with_Guidewire
Git_and_GitHub Integration_with_Guidewire
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__grey
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__white
 

Dernier

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Dernier (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Hacktoberfest intro to Git and GitHub

  • 2. Introduction to Git and GitHub
  • 3. AGENDA 1. Introduction to Version Control System - What is Version Control System - Centralised vs Distributed Version Control Systems 2. Introduction to Git - What is Git - Configuring Git and Creating repositories - Add, commit, push - The .gitignore file - Branches - Synchronising changes and Make changes 3. Introduction to GitHub - What is GitHub - Collaborating using Git and GitHub
  • 4. Version Control System - A way to manage files and directories - Track changes over time - Recalls previous versions
  • 6. Git What is Git? Git is distributed version control software.Git repository has a copy of that entire repository - every commit, every branch, every file. Why use Git ● Speed ● Merge Conflicts ● Cheap Branches ● Ease of roll back
  • 7. Configure Tooling Configure user information for all local repositories $ git config --global user.name "[name]" Sets the name you want attached to your commit transactions $ git config --global user.email "[email address]" Sets the email you want attached to your commit transactions ⚙
  • 8. Creating Repository When starting out with a new repository, you only need to do it once; either locally, then push to GitHub, or by cloning an existing repository. $ git init Or $ git clone [url] Clone (download) a repository that already exists on GitHub, including all of the files, branches, and commits
  • 9. git add The git add command adds new or changed files in your working directory to the Git staging area. Few commonly used git add commands are: $ git add <path> Stage a specific directory or file $ git add . Stage all files (that are not listed in the .gitignore) in the entire repository $ git add -p Interactively stage hunks of changes
  • 10. git status $ git status shows the current state of your Git working directory and staging area. Why use git status? The git status command only outputs information, it won't modify commits or changes in your local repository. What kind of information do we get? Where HEAD is pointing, whether that is a branch or a commit . If changed files are staged or not
  • 11. git commit git commit creates a commit, which is like a snapshot of your repository. These commits are snapshots of your entire repository at specific times. It should tell a story of the history of your repository and how it came to be the way that it currently is. How to use git commit? git commit -m "descriptive commit message" git commit -am "descriptive commit message" git commit --amend
  • 12. The .gitignore file A .gitignore file is a plain text file where each line contains a pattern for files/directories to ignore. Generally, this is placed in the root folder of the repository. You can also have multiple .gitignore files. Why use .gitignore? It is too easy to accidentally commit files containing sensitive information or unnecessary files. The .gitignore file comes in handy, escaping from these accidents. https://www.toptal.com/developers/gitignore -> This link can be used to generate .gitignore files effortlessly.
  • 13. git push $ git push uploads all local branch commits to the corresponding remote branch. You can think of git push as “update” or “publish”. It only updates the corresponding branch on the remote. Common usages for git push ● $ git push -f ● $ git push -u origin [branch] ● $ git push --all
  • 14. Branches A branch in Git is simply a lightweight movable pointer to one of these commits. The default branch name in Git is master . As you start making commits, you're given a master branch that points to the last commit you made. Every time you commit, the master branch pointer moves forward automatically. Creating a New Branch $ git branch <branch name> Switching Branches To switch to an existing branch, you run the git checkout command. $ git checkout <branch name> This moves HEAD to point to the <branch name> branch.
  • 15. git pull git pull updates your current local working branch, and all of the remote tracking branches. Common usages and options for git pull ● $ git pull ● $ git pull --rebase ● $ git pull --force ● $ git pull --all
  • 16. Synchronising changes $ git fetch Downloads all history from the remote tracking branches $ git merge Combines remote tracking branches into current local branch
  • 17. Make changes $ git log Lists version history for the current branch $ git log --follow [file] Lists version history for a file, including renames $ git diff [first-branch]...[second-branch] Shows content differences between two branches $ git show [commit] Outputs metadata and content changes of the specified commit
  • 18. How to Undo Commits in Git $ git revert git revert looks at the changes introduced in a specific commit, then applies the inverse of those changes in a new commit. $ git reset git reset is a very powerful command that may cause you to lose work. By resetting, you move the HEAD pointer and the branch pointer to another point in time - maybe making it seem like the commits in between never happened
  • 19. Introduction to GitHub GitHub is a repository hosting platform for version control system git. It lets you and others work together on projects from anywhere.
  • 20. Collaborating with GitHub Adding collaborators in GitHub repository A. On GitHub, navigate to the main page of the repository. B. Under your repository name, click Settings. C. In the left sidebar, click Manage access. D. Click Invite a collaborator and Add NAME to REPOSITORY. E. The user will receive an email inviting them to the repository.

Notes de l'éditeur

  1. git init turns any directory into a Git repository. To initialize a repository, Git creates a hidden directory called .git. That directory stores all of the objects and refs that Git uses and creates as a part of your project's history. This hidden .git directory is what separates a regular directory from a Git repository. The git clone command is used to create a copy of a specific repository or branch within a repository. To start a repository, use either git init or git clone - not both. git init: One Person Starting a New Repository Locally git clone: The Remote Already Exists
  2. git commit creates a commit, which is like a snapshot of your repository. These commits are snapshots of your entire repository at specific times. You should make new commits often, based around logical units of change. Over time, commits should tell a story of the history of your repository and how it came to be the way that it currently is. Commits include lots of metadata in addition to the contents and message, like the author, timestamp, and more. git commit -m "descriptive commit message": This starts the commit process, and allows you to include the commit message at the same time. git commit -am "descriptive commit message": In addition to including the commit message, this option allows you to skip the staging phase. git commit --amend: Replaces the most recent commit with a new commit.
  3. What Kind of Files Should You Ignore? Log files Files with API keys/secrets, credentials, or sensitive information Useless system files like .DS_Store on macOS Generated files like dist folders Dependencies which can be downloaded from a package manager And there might be other reasons (maybe you make little todo.md files)
  4. git push updates the remote branch with local commits. It is one of the four commands in Git that prompts interaction with the remote repository. You can also think of git push as update or publish. By default, git push only updates the corresponding branch on the remote. So, if you are checked out to the master branch when you execute git push, then only the master branch will be updated. It's always a good idea to use git status to see what branch you are on before pushing to the remote. Common usages and options for git push git push -f: Force a push that would otherwise be blocked, usually because it will delete or overwrite existing commits (Use with caution!) git push -u origin [branch]: Useful when pushing a new branch, this creates an upstream tracking branch with a lasting relationship to your local branch git push --all: Push all branches
  5. https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell
  6. Common usages and options for git pull git pull: Update your local working branch with commits from the remote, and update all remote tracking branches. git pull --rebase: Update your local working branch with commits from the remote, but rewrite history so any local commits occur after all new commits coming from the remote, avoiding a merge commit. git pull --force: This option allows you to force a fetch of a specific remote tracking branch when using the <refspec> option that would otherwise not be fetched due to conflicts. To force Git to overwrite your current branch to match the remote tracking branch, read below about using git reset. git pull --all: Fetch all remotes - this is handy if you are working on a fork or in another use case with multiple remotes.