Skip to content

boulaya66/my-git-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing my git flow

Documentation

Useful commands

Show branches

Command Description
git fetch --all Fetch all remotes
git branch -a List both remote-tracking branches and local branches.
git branch -r List the remote-tracking branches.

Rename branches

Command Description
git $branch -m new-name Rename local branch, assuming we're in.
git push origin :$branch new-name Delete the old-name remote branch and push the new-name local branch.
git push origin -u new-name Reset the upstream branch for the new-name local branch,assuming we switched to it.

Show status

Command Description
git rev-parse --abbrev-ref HEAD Retrieves current branch name
git branch --show-current Retrieves current branch name
git symbolic-ref --short HEAD Retrieves current branch name
git rev-list --count --left-right origin/$branch...HEAD print the counts for left and right commits, separated by a tab
git log --pretty='format:%H %s' Customized logging: full commit tag and name
git log --graph --pretty='format:%H %s' Same with graph option
git status -s Give the output in the short-format.
git rev-parse --show-superproject-working-tree Retrieve super project from within submodule.
``

Undo

Command Description
git checkout HEAD file
git reset file
git reset --soft HEAD~1
git commit --amend --no-edit

--- end of file ---

About

test git commands for special use cases

Resources

License

Stars

Watchers

Forks

Packages

No packages published