Ravi Kumar
Ravi Kumar

@ravikmmr

9 Tweets 4 reads Jul 07, 2022
Git command that you should definitely know
Steps to upload your code to github.
πŸ§΅πŸ‘‡
1⃣ Git config
this command is used to set up a name or email that is associated with your GitHub account and link-local the machine to Github.
syntax :
git config –-global user.name β€œ[name]”
git config -–global user.email β€œ[email address]”
2⃣ Git Init & GIt add
cd // used to change directory
git init [repository name] // used to initalisize your repository
git add [file] // used to add your repo into a staging area
git add . // used to add all files.
3⃣ Git commit
git commit -m β€œ[ Type in the commit message]”
// used to add commit your changes into a staging area like file addition, deletion, etc.
4⃣ Git log & Git status
git log //used to check the history of the current branch.
git status // used to see the list of files that have to be committed.
5⃣ Git branch
git branch // used to list all branches
git branch [branch name] // used to create branch
git branch -d [branch name] // used to delete branch
git checkout [branch name] // used to switch from one branch to other
git merge [branch ] // merge branches.
6⃣ Git remote
git remote add [variable name ] [Remote Server Link]
// used to connect the local repository to a remote server.
7⃣ Git push & Git pull
git push [variable name] master
// used to send the local commit to the remote repository
git pull [Repository Link]
// used to fetch servers commit to local commit.
Thanks for reading the thread.
If you find it useful. Give the first one a retweet and if you have any feedback, let me know in the comment.
πŸ”—

Loading suggestions...