Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
1 views

Updated Common Git Commands

Uploaded by

Teddy Bare
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Updated Common Git Commands

Uploaded by

Teddy Bare
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Updated Common Git commands

ssh-keygen Generates a public and private key


for you to use to SSH to the GitHub
github status Shows a lot, especially if there are
any untracked files, and shows the
branch you’re on
Git commit -m “Your message so To commit locally
others know what change you’ve
made”
Git push origin [branch_name] To push to a remote server, default
branch is main but depending on
your work, you’ll push to a different
branch and it will later be merged
with the main
*To ensure that the changes made
to the new branch appear on the
remote server, use this
Git add [directory/file] To stage a file/directory for the
next commit
Ls -al To show hidden files
Git checkout -b [branch_name] To create a new branch
Git clone [ssh url] To update your local code to the
one on the remote server
Git branch -a Shows all branches
Git log As the name suggests, it gives a
log of past commits on your device
and the author
Git checkout [branch_name] To go to a certain branch
Git pull *To be done on the main branch
Merge your local repo with the
remote repo to add any changes
made on the local repo to the main
repo
Git merge [main_branch] *To be done on the outdated
branch(not main branch)
Merge the main remote repo with
your local repo and in doing so,
update your local repo
Merge the main remote repo with
your local repo and in doing so,
update your local repo

You might also like