Why mlflow tracks git commits, we already have run_id for tracking experiment. Can we use those commits to go back to previous commit like we do in git.
Related
As in the title: there's always the statement The source branch is 1 commit behind the target branch. How is it even possible: both master and develop branches are up to date, no one made any modifications in the meantime, and the merge request gets created via GUI operating on the most up to date version of the repository, isn't it?
I read GitLab documentation saying that it could be the merge commit counted as this 1 commit behind, so I changed my project settings to:
It didn't change anything however: there's still the same message:
So far, I make a rebase in the following way:
git checkout master
git pull
git checkout develop
git merge master
git push
to line up the branches, but I'd like to save myself these few additional steps. Is it possible to achieve?
I want to test my pipeline and not have a commit everytime i make a change. Is there a way to prevent this, in order not to have a bunch of unnecessary commits on my develop branch?
You can use git commit --amend to push the commit into the previous one, this will trigger the pipeline to run with the new changes without "bloating" your git history with many commits.
Here is a tutorial to help you out: https://www.atlassian.com/git/tutorials/rewriting-history
I pushed an existing git project to Gitlab and wanted to have an intuitive impression of git commits history through the Gitlab heatmap. Yet from the heatmap, I could only tell that I pushed to this repo that day and all the previous git commit history wouldn't reflect in the heatmap.
Is there a way to show my previous git commits in the heatmap? Or is the heatmap only to reflect the actions caused by git push?
It might be:
a refresh issue (GitLab might take time analyzing the full commit history of the newly pushed repository to update the heatmap)
a branch issue (mostly commits from master might only be shown)
a date issue (maybe some commits are too old to be show in the activity heatmap default time scale)
I'm new to Git and I'm really confused here. I have a HTTPS from my github, and I am using terminal from a virtual box to try to pull the latest files from one of my branches.
Everytime I use the following command:
git pull http-link or git clone http-link
it only pulls the files from the master branch, and not ALL the branches. I know this because when I run git branch I only see the master branch, and not the develop branch that I have in github. I want the files from this develop branch (NOT master) so I can push the changes to that branch, before merging to master. Please advise.
it only pulls the files from the master branch, and not ALL the branches
The rules for pull are somewhat configuration-dependent, but I can tell you that when you clone it is getting the entire history (all branches) unless you give it specific options telling it not to (such as --single-branch).
I know this because when I run git branch I only see the master branch
That's because by default git branch lists the local branches, and not every known branch from the remote(s). You can say
git branch -a
to see the rest. They'll appear with names like
remotes/origin/branch-name
because what you have are not proper branches; rather these are sort of "bookmarks" that tell you where the remotes branches were, when last you fetched from the remote.
By default, cloning does not automatically create local branches for every branch on the remote (but it does fetch the branches). By default cloning does check out the default branch from the remote (master in this case), creating the local branch for it. And there are shortcuts built in to git such that, in a typical configuration with a single remote, you can say
git checkout branch-name
to create the local branch corresponding to the remote's branch-name branch.
Note that when you do this initial checkout, you don't want to say
git checkout remotes/origin/branch-name
because that does something else. Rather than create the local branch, this simply puts you in "detached HEAD" state, with HEAD on the same commit as the remote branch.
I am working on my master branch and have some uncommitted changes inside the master branch. I have already created a feature branch and I am able to switch to my feature branch using the git checkout feature_branch command. I have couple of doubts here which I am listing below:
Why am I seeing the uncommitted changes in my branch when I have made my changes inside my master branch. If I commit my changes in the master branch and switch to my feature branch, I do not see the committed changes specific to master. I am expecting the same behavior for uncommitted changes also.
I came across the stash command in Git and there it was mentioned that if you have any uncommitted changes inside the master branch, and would like to switch to some other branch, git will not allow you and hence you need to stash the changes inside the master branch and then only switch to the development branch. I did not face this issue. Am I missing something here and if so, what is the significance of using the stash command?
If I commit my changes in the master branch and switch to my feature branch, I do not see the committed changes specific to master. I am expecting the same behavior for uncommitted changes also.
That's not a sensible behavior. Uncommitted changes are by definition not made to a branch. Branches are pointers to commits, and there is no commit associated with uncommitted changes. They are made to your working directory and have nothing tying them to any branch. They aren't even associated with Git. Until you commit (or stash) them, Git does absolutely nothing to track them, and it will never try to manage them for you.
I came across the stash command in Git and there it was mentioned that if you have any uncommitted changes inside the master branch, and would like to switch to some other branch, git will not allow you and hence you need to stash the changes inside the master branch ...
That's wrong. Stashes don't exist inside any branch. There is one global pool of stashes.
... I did not face this issue.
You will only be prevented from switching branches if doing so would cause your uncommitted changes to be overwritten.
Am I missing something here and if so, what is the significance of using the stash command?
You only need to worry about stashing your changes if they affect any files that would be changed by switching branches. If you have modifications to a file that is identical between two branches, switch from one branch to the other will not require a stash. If the file is different on your other branch, Git will not let you switch branches, as this would destroy your uncomitted changes.
It is safe to try switching branches, and if Git warns you that "uncommitted changes would be overwritten" and refuses to switch branches, you can stash your changes and try again.