There are several more things to learn about Git, I will explain them in a separate post. So these are the most helpful git commands I find in my everyday programming. Git config -global user.email globally Email id Git list all branches tags and remotes, with commit hash and date 0. Find out the date/time for the last update of a branch in a remote Git repository via command line. show git branches with date of last commit. Using git branch -r lists all remote branches and git branch -a lists all branches on local and remote. Git - View Remote branches by creation date. Git config -global user.name "your_username" List all the active branches in Git remote. In order to operate on remote branches, a remote repo must first be configured and added to the local repo config. The git branch command also works on remote branches. It doesn’t let you switch between branches or put a forked history back together again. Git remote set-url origin a repository's origin branch to SSH The git branch command lets you create, list, rename, and delete branches. Git remote add origin a remote repository Update local repository to the newest commit Push changes to remote repository (remembered branch) Push changes to remote repository (and remember the branch) Stash changes in a dirty working directory List of branches (the asterisk denotes the current branch) ![]() This can be used to track a subset of the available remote branches after the initial. If youre setting up a new Git repo after running git init, you will need to do this as well, since you wont have a remote by default. ![]() Useful Git Commands List CommandĪdd all new and changed files to the staging area set-branches Changes the list of branches tracked by the named remote. If you want to switch remotes, like in the case of forking a Github repo and pushing updates to your own repo, youll need to delete the old remote: git remote rm origin. So I'm going to share the most useful Git commands in this post that every developer should know.īut first you need to know the fundamentals of Git to understand this article. But some commands are more commonly used. Since you can use a lot of different commands, mastering Git needs time. ![]() Git is an important part of daily programming and is commonly used in the software industry.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |