This document is a beginner's guide to Git consisting of multiple parts. It introduces Git as a version control system for tracking file versions and collaborating with developers. Each developer has their own local copy of the repository. Changes are committed locally and then published to a remote Git repository for sharing. The document outlines setting up Git and creating accounts on GitHub. It demonstrates basic Git commands like git init to initialize a repository, git status to check the status, git add to stage files, and git commit to commit changes locally. The next part will cover pushing commits to a remote repository.
This document is a beginner's guide to Git consisting of multiple parts. It introduces Git as a version control system for tracking file versions and collaborating with developers. Each developer has their own local copy of the repository. Changes are committed locally and then published to a remote Git repository for sharing. The document outlines setting up Git and creating accounts on GitHub. It demonstrates basic Git commands like git init to initialize a repository, git status to check the status, git add to stage files, and git commit to commit changes locally. The next part will cover pushing commits to a remote repository.
This document is a beginner's guide to Git consisting of multiple parts. It introduces Git as a version control system for tracking file versions and collaborating with developers. Each developer has their own local copy of the repository. Changes are committed locally and then published to a remote Git repository for sharing. The document outlines setting up Git and creating accounts on GitHub. It demonstrates basic Git commands like git init to initialize a repository, git status to check the status, git add to stage files, and git commit to commit changes locally. The next part will cover pushing commits to a remote repository.
This document is a beginner's guide to Git consisting of multiple parts. It introduces Git as a version control system for tracking file versions and collaborating with developers. Each developer has their own local copy of the repository. Changes are committed locally and then published to a remote Git repository for sharing. The document outlines setting up Git and creating accounts on GitHub. It demonstrates basic Git commands like git init to initialize a repository, git status to check the status, git add to stage files, and git commit to commit changes locally. The next part will cover pushing commits to a remote repository.
https://docs.github.com/en/get-sta rted/quickstart/create-a-repo 3. git init ➔ It initializes an empty repository as a git repository on your local machine.
➔ As shown below: We've created
an empty folder - "first-repo" and run the "git init" command to mark it as a git repository. ➔ Let's add an empty file - "script.js" in this local git folder - "first-repo". 4. git status
➔ git status will show a list of all files
along with their status.Newly added files will be "untracked" by git initially.
➔ As shown below in the untracked file
list we can see "script.js" 5. git add ➔ Out of all the untracked files, we can pick which file to commit. This is called staging.
➔ Use Below Command to stage a file:
git add <file>
➔ Below we've added "script.js" to the stage and then
used git status to check its status. 6. git commit
➔ Now, its time to commit the file to our local
repository using git commit -m <commit-message>
➔ Below we've committed the "script.js" file with a
commit message. ➔ So far, we've committed the above file in our local repository only. Now it's time to push this file to remote repo.
➔ If you remember, I've asked you to
create a repo on GitHub in the prerequisite section. Now it's time to use it. Please get the link to your remote branch ready.
➔ We will continue in the Part 2
❤ Thanks for reading !
For more content on
Java & Backend Development, follow me on below handles