-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-commands.txt
34 lines (26 loc) · 1.35 KB
/
git-commands.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
git config for the first time
------------------------------
git config --global user.name "John Doe"
git config --global user.email [email protected]
git config --list - will give you configuration details
Git Commands to push the code to remote repository
--------------------------------------------------
1. git init - To initialize the repository
2. git remote add origin https://github.com/vjaideep08/HTML5-and-CSS3-22-06-2022.git - Connect your local repository to remote repository
3. git status - To check the status of the files to see if they are created /modified
4. git diff - to see the changes made to the files
to add files:
5. git add filename - To add file to local git repository
6. git add . - To add multiple files to local git repository
7. git commit -am "added new files to repository" - This will commit all the changes made to files to local repository
8. git push origin main/master - To push the changes to remote repository
9 git pull origin main/master - To pull the changes from remote repository
10. git clone - will fetch your remote repo to your local folder
11. git checkout -b feature/branchname - to create a new branch
12. git branch
to delete a branch:
13. git branch -d
git config --global --remove-section user - To remove global name and email
How to remove remote origin
----------------------------
git remote remove origin