Learning Emacs
“There is no end, my friend” David Goggins
- Some Knowledge of Emacs
- Non-Expert Guidelines: Only for Personal Github
- Always Beware of Changes: if there are changes in the remote main branch, fetch the changes before changing the local main or better, create a local branch of main and later, merge the changes.
- Create/Select a repository on Github
- Clone the Repo to your Local Computer
M-x magit-clone
- Make your Changes or Add new files in Repo folder
- In the Repo, press
C-x g
or in minibufferM-x magit-status
- Check If there are untracked or unstaged changes from files,
press s
to stage desired or all files. - Better to split window before committing. It will automatically bring up the staged changes buffer and the committing buffer, easier to add comments.
- Once the status changed to staged, add commit (comments),
press c (2x)
- In Commit Section: press
C-c C-c
to save and finish, or pressC-c C-k
to cancel
- In Commit Section: press
- After committing, the
M-x magit-status
will show the commits in theUnmerged into x/y
orUnpushed to x/y
Press P
to push changes thenPress p
to push main to upstream to the Github Repository.- In case of failure, try
-F
–force option with push main to- It can happen, if you are working on two repositories simultaneously which ever uses –force option will be worked on
- In case of failure, try
- Depending on option, it can either ask for the SSH passphrase or Github username and password.
- Message in the minibuffer
Git finished
- The
magit-status
shows sectionRecent Commits
at the top the last commit made to the repository in Github.Press Tab
to unfold the list of all recent commits
- In the Repo, press
C-x g
or in minibufferM-x magit-status
- If there are unstaged or uncommitted changes,
M-x magit-reset-hard
- Once all cleared, go to the
M-x magit-status
buffer, pressF
eitherp
oru
to pull into main or master from origin/master or origin/main
Go to C-x g
, Magit Status
Press b
for Git Branch
options
Press n
to create a new Branch
Stackoverflow: Put Current Changes in a New Git Branch
Press b (2x)
to switch to New Git Branch
Now, follow the normal process of pull or push to New Branch
press C-x G
magit status
press b
for branch options
press k
to delete the Branch
Yes
Delete it Remotely + Locally
No
Delete it Locally