git reset for beginner


In this post, I would like to share git reset command for beginner developer.

🎳 Cancel Commit: git reset

When you run the folloing command, master now points to “one before commit”, but the index stille has your changes.

git reset --soft HEAD~1

🚌 Fix comment again

git commit --amend -m "Fix git comment, again"

🐰 Ignore file changes with Git

assume-unchanged

# Ignore file changes with Git
git update-index --assume-unchanged [file_name]

# Enable to observe file change again
git update-index --no-assume-unchanged [file_name]

skip-worktree

# Ignore file changes with Git
git update-index --skip-worktree [file_name]

# Enable to observe file change again
git update-index --no-skip-worktree [file_name]

🚜 References

🖥 Recommended VPS Service

VULTR provides high performance cloud compute environment for you. Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour). In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!