Background
A few posts ago we touched on a couple of git commands.
Let us talk about git reset.
Thankfully, rarely use it.
Lineage
Here are relevant preceding posts:-
- Git – Client – Commands
Link
Scenario
Here is what led to this post.
I created a couple of files.
But, did not like the folder that I created the files under.
Structurally, it made more sense to place the file in a new separate folder.
Outline
- Show Current Status
- git status
- Rollback Local Git Changes
- git reset
- Show Current Status ( Post Git Reset )
- git status
- Move Files
- Use File System file move commands
- In Linux
- Use mv
- Add Files referencing the new location
- git add
- Show Current Status ( Post Git Add )
- git status
- Re-Commit Changes
- git commit
- Upload Changes ( Upload local repository content to a remote repository )
- git push
Tasks
Show Current Changes
git status
Syntax
git status
Sample
git status
Output
Output – Image
git reset
Syntax
git reset
Sample
git reset
Output
Output – Image
git status – “Post Git Reset”
Syntax
git status
Sample
git status
Output
Output – Image
Move Files
Linux
mv
Syntax
mv <filename> <folder-destination>
Sample
mv person.sql model
git add
Syntax
git add <filename>
Sample
git add model\person.sql
git status – “Post Git Add”
Syntax
git status
Sample
git status
Output
Output – Image
git commit
Syntax
git commit
Sample
git commit
git push
Syntax
git push
Sample
git push