Skip to content

Instantly share code, notes, and snippets.

@NirajanMahara
Last active April 9, 2021 09:33
Show Gist options
  • Save NirajanMahara/d1335753a83b1bf51f18d255e745185b to your computer and use it in GitHub Desktop.
Save NirajanMahara/d1335753a83b1bf51f18d255e745185b to your computer and use it in GitHub Desktop.
Important Git Commands
<h1>Summary of Workshop 5 Step wise process</h1>
1. fork the original repo
2. git clone [https://github.com/NirajanWEB/WorkshopGroup10.git | https of your forked repo]
3. cd WorkshopGroup10
4. git checkout participants
5. Edit Files
6. git status
7. git add -p / git add .
8. git status
9. git commit -m "your commit message"
10. git remote -v
11. git push origin participants
12. git log
13. go to your repo
14. forked repo will be ahead of [from-forked repo]
15. changes brach to participants
15. Create pull request to branch from your branch
_____________________________________________________________________________________
RAW
1. Initialize git - git init <foldername>
2. Create .gitignore and readme.md
3. Track / Stage files/folder (untracked files or unstaged lines)
git add <file/folder name>
git add -p / git add .
4. git status
5. git commit -m "verb1 with message"
6. Creating new branch
git checkout -b <branchname>
7. Branches
git branch
8. change branch
git checkout <branchname>
main>> git merge <branchname>
current change - from same branch
incoming change - from branch
accept both changes
again modified
git add .
git commit --m "messages"
___________________________________________
git remote -v
git remote origin <https.git>
git remote -M main
___________________________________________
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment